Shoutbox

JavaScript code execute within url - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: JavaScript code execute within url (/showthread.php?tid=49773)

JavaScript code execute within url by DJeX on 08-31-2005 at 05:27 AM

How would I run a JavaScript function from the url. Would it be something like

http://www.mysite.com/page.html?functionname()


RE: JavaScript code execute within url by ShawnZ on 08-31-2005 at 05:33 AM

um, javascript://run_some_function()?


RE: JavaScript code execute within url by DJeX on 08-31-2005 at 05:37 AM

Ermm maybe I didn't explain my self, how do I run a function in a web page useing the URL of the page.

like: http://www.bla.com/page.html(then the function to run here)


RE: JavaScript code execute within url by ShawnZ on 08-31-2005 at 05:51 AM

errrrrrrr, ".$_GET[0]."" ?>

I think?


RE: JavaScript code execute within url by surfichris on 08-31-2005 at 06:00 AM

Can't do that with javascript - you cant obtain get and post variables.


RE: JavaScript code execute within url by L. Coyote on 08-31-2005 at 06:07 AM

Maybe he meant to put that $_GET between <script> and </script> so JS was executed when the page was output as HTML.


RE: JavaScript code execute within url by Yousef on 08-31-2005 at 06:13 AM

quote:
Originally posted by Regexp
Can't do that with javascript - you cant obtain get and post variables.
Shouldn't you be able to obtain the GET variables using document.location...?
RE: JavaScript code execute within url by -dt- on 08-31-2005 at 06:44 AM

quote:
Originally posted by DJeX
Ermm maybe I didn't explain my self, how do I run a function in a web page useing the URL of the page.

like: http://www.bla.com/page.html(then the function to run here)
thats in possible you cant run javascript with a url like that , only by using the protocol javascript://
nothings stopping you parsing the url eg
http://blah.com/page.html?functiontorun
then just a quick eval to run that function.

quote:
Originally posted by Juzzi
quote:
Originally posted by Regexp
Can't do that with javascript - you cant obtain get and post variables.
Shouldn't you be able to obtain the GET variables using document.location...?
yup just need to write some sort of parser to do it.
RE: JavaScript code execute within url by Matti on 08-31-2005 at 07:07 AM

But thats only possible with PHP... ;)


RE: JavaScript code execute within url by segosa on 08-31-2005 at 11:40 AM

Unless you can execute javascript with a javascript function..


RE: JavaScript code execute within url by DJeX on 08-31-2005 at 04:55 PM

ahh i c, ok thanks.


RE: JavaScript code execute within url by Yousef on 08-31-2005 at 05:08 PM

quote:
Originally posted by segosa
Unless you can execute javascript with a javascript function..
eval()