...

View Full Version : get URL function?



alanb2003
01-19-2003, 05:07 PM
hi,

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
Alan

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



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

mordred
01-19-2003, 05:36 PM
http://ashleyit.com/rs

alanb2003
01-19-2003, 06: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..."

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

thanks mordred

Alan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum