Solved

What am i doing wrong?

Posted on 1997-12-19
4
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

739 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