[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

What am i doing wrong?

<HTML>
<HEAD>
</HEAD>
<SERVER>
<!--
function replaceString(oldS,newS,fullS) {
   for (var i=0; i<fullS.length; i++) {
      if (fullS.substring(i,i+oldS.length) == oldS) {
         fullS =
fullS.substring(0,i)+newS+fullS.substring(i+oldS.length,fullS.length)
      }
   }
   return fullS
}

function makenew(searchText,oldS,newS,fullS)
source = "http://www.webcrawler.com/cgi-bin/WebQuery?"+ searchText +""
source.open("r")
info = source.read(999999)
replaceString(oldS,newS,fullS)
if (source.open("r")) {
   target = ""+ searchText +".html"
   target.open("w")
   while (!source.eof()) {
      data = source.read(1)
      target.write(data);
   }
   source.close();
}
   target.flush()
   target.close()
window.location="http://www.spiritone.com/~groovy/" + searchText +".html"
//-->
</SCRIPT>
</SERVER>
<BODY>
<form>
<INPUT TYPE="text" NAME="searchText" SIZE="30"><INPUT TYPE="submit"
VALUE="Search"
onSubmit="makenew(searchText,"Webcrawler","Webscrewed",info)">
</form>
</BODY>
</HTML>

0
overgroove
Asked:
overgroove
  • 2
1 Solution
 
rigansenCommented:
sometimes there's no need to execute the code to see what the error is... so if you just could tell!
0
 
tecbuilderCommented:
Here are a few fixes to try in your code.

Change the tag that says <server> to <script language="javascript">

Replace your form's code with this code.
<form onSubmit="makenew(searchText,'Webcrawler','Webscrewed',info)">
<INPUT TYPE="text" NAME="searchText" SIZE="30">
<INPUT TYPE="submit" VALUE="Search">
</form>

Beyond this you need to tell us what you are wanting to do and what is going wrong.
0
 
overgrooveAuthor Commented:
ok....  I think that I assumed that the person answering would know what I was trying to do... ok this is a server side javascript program that saves incoming html, replaces certain words and then lets the person load the edited html.. this is the true question...  
0
 
tecbuilderCommented:
I would suggest reposting your question and include a description of the problem (what it's supposed to do and what it's not doing), any errors you are getting, the code, and state that this is a server-side problem.  You also need to watch your email and respond to answers and comments as they are made.  I am not sure if you graded this question or not (I don't believe you did) and after 20 days the question was automatically graded.  I have no control over this.

99% of all JavaScript questions relate to the client-side and unless the description specifically says that the question relates to server-side most people (including myself) believe the question relates to client-side.  Many of the options and tags that server-side has are not known on the client-side (for obvious reasons).

I am sorry that your question was not resolved and I wish I could help more, but I don't know server-side JavaScrip.  I am sure that if you re-post the information I mentioned above, you will get an answer that will work for you.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now