Solved

What am i doing wrong?

Posted on 1997-12-19
4
146 Views
Last Modified: 2006-11-17
<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
Comment
Question by:overgroove
  • 2
4 Comments
 
LVL 2

Expert Comment

by:rigansen
ID: 1277030
sometimes there's no need to execute the code to see what the error is... so if you just could tell!
0
 
LVL 6

Accepted Solution

by:
tecbuilder earned 200 total points
ID: 1277031
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
 

Author Comment

by:overgroove
ID: 1277032
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
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277033
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question