View Full Version : get URL function?

01-19-2003, 06:07 PM

Can anyone help... I need to get javascript to request a url that then returns a string by calling an ASP script ....

What I need to know, is can javascript do this, and "capture" the results to a string variable, that I can then interpret and take whatever action.

I need it to happen without having to put anything out to the current web page - is this possible...?

It needs to be able to call the server "in the background" of the page, and process results returned ... perhaps with a timer, and then take appropriate action based on the return results.

Is javascript this advanced? (I could always use a hidden frame that refreshes itself to make sure that my ASP script is called, perhaps).

Hope I haven't confused you all!! ;-)

Thanks in Advance for any help

01-19-2003, 06:23 PM
Something like this?

<script type="text/javascript">
document.write("<img src=\"something.asp?URL="+window.location+"\" width=\"1\" height=\"1\" />")
// -->

01-19-2003, 06:36 PM

01-19-2003, 07:18 PM
Well, this is what I need ... in psuedo-code:

var str = getURL("something.asp");

so str would be populated with what-ever gets returned from something.asp (HTML or text) (similar to typing the URL in a browser window, but instaed of having the page returned, it simply populates a variable)

then I am free to process the contents of str as I please:

eg. if str="help" then document.write "click here for help..."

01-19-2003, 07:20 PM
remote scripting - that sounds like what I need!!

thanks mordred