I was wondering if i can to make url such like this:
http://www.google.com/index.php?id=mycustomsearch,javascript:onload=initfunction1();
To make myself clear i’ll explain.
I want to modify the link to make a javascript action.
To be able to give the same exact page but triger every time another function based on the link.
I wrote [,] just for demonstration. I dunno if there is a way to do it.
Okay do not approach the problem via a query string in the URL. This is will open your site up to XSS attacks. http://en.wikipedia.org/wiki/Cross-site_scripting
If you wanted to run a JavaScript function once the page has loaded use
JavaScriptorjQueryand do something like:You could filter the function name via the query string, sure, however do not embed JavaScript into the URL.