By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

executing/calling a url

P: n/a
I have a perl script running on my server on a chosen port, and I want
to be able to execute functions that this script provides from inside
Javascript functions.

For example, I need to call

http://localhost:36000/reset?sid=1

I know very little Javascript and haven't had any luck searching here,
so if anyone can help that woudl be great.

Thanks

Nov 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

jo******@gmail.com wrote:
I have a perl script running on my server on a chosen port, and I want
to be able to execute functions that this script provides from inside
Javascript functions.

For example, I need to call

http://localhost:36000/reset?sid=1

I know very little Javascript and haven't had any luck searching here,
so if anyone can help that woudl be great.

Thanks
Simply call

location = "http://localhost:36000/reset?sid=1";

This will replace the current page with the result of this request.

If you need to do this invisibly, you will have to use AJAX. If needed,
I can give you an example.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 14 '06 #2

P: n/a
Laurent Bugnion said the following on 11/14/2006 6:26 AM:
Hi,

jo******@gmail.com wrote:
>I have a perl script running on my server on a chosen port, and I want
to be able to execute functions that this script provides from inside
Javascript functions.

For example, I need to call

http://localhost:36000/reset?sid=1

I know very little Javascript and haven't had any luck searching here,
so if anyone can help that woudl be great.

Thanks

Simply call

location = "http://localhost:36000/reset?sid=1";

This will replace the current page with the result of this request.

If you need to do this invisibly, you will have to use AJAX. If needed,
I can give you an example.
AJAX but only if you need to use the return value. Otherwise, setting
the .src of an image does the trick.

<URL: http://jibbering.com/faq/#FAQ4_34>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 14 '06 #3

P: n/a
or the source of an iframe, then you can get the return value by
calling the innerHTML of the iframe, thats the way google provides
feedback about uploading a file in gmail while youre still writing. the
return of the perl script must have decent mimetype, and could even be
the word OK! - as in google

Nov 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.