Solved

What am i doing wrong?

Posted on 1997-12-19
4
142 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now