admin管理员组

文章数量:1399978

What I want to do is when I reach the site the link guide to, then execute some javascript

So is it possible include javascript code in url link, or I can attach a javascript file link after the url?

Edited: for instance, when the someone reach my twitter site, then execute some js, the js could click the "follow" button automaticly

What I want to do is when I reach the site the link guide to, then execute some javascript

So is it possible include javascript code in url link, or I can attach a javascript file link after the url?

Edited: for instance, when the someone reach my twitter site, then execute some js, the js could click the "follow" button automaticly

Share Improve this question edited Feb 24, 2013 at 6:50 hh54188 asked Feb 24, 2013 at 6:44 hh54188hh54188 15.7k35 gold badges116 silver badges192 bronze badges 3
  • Explain what you mean by "reach the site" – JohnFx Commented Feb 24, 2013 at 6:47
  • This smells like an XY problem. What are you actually trying to acplish with this? – Matt Ball Commented Feb 24, 2013 at 6:47
  • So you just want to run some JS code when people go to your site? Just add it in the body onload event. – JohnFx Commented Feb 24, 2013 at 7:10
Add a ment  | 

3 Answers 3

Reset to default 4

No. It would be a huge security risk to allow that.

You need to see this: Bookmarklet

A bookmarklet is unobtrusive script written in JavaScript and stored as the URL of a bookmark in a web browser or as a hyperlink on a web page.

no you can not add javascript code into url link.

本文标签: Is it possible include javascript in url linkStack Overflow