开发者

running JavaScript function on url? google.com?javascript:(func())

I would like to run 开发者_StackOverflowjavascript function after link load. Link is for example google and I would like to run function after load, without pressing any bookmarks etc. Is it possible to make a link like

http://google.com?javascript:(function(){}(something here);)

Thanks for your answers


This is not possible, because if it were, then XSS attacks would potentially be around the corner of every link.


Nope, URLs just don't support this. There are bookmarklets the user can use once the page loads, but nothing you can automatically run as part of a URL.


That is impossible. You cannot control the code on other pages (this would be a huge security problem).


As everyone else has noted, you cannot run a Javascript function that way.

What is it that you're hoping to accomplish with your javascript? Perhaps there is another way to achieve your end result?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜