JavaScript in specified URL?

hockeygoalie5

In Runtime
Messages
299
Location
United States
Is it possible to put JavaScript in a URL. For example, you're on mysite.org and there's a link leading to mysite.org/morestuff. Is it possible to put JavaScript in the URL? (e.g. mysite.org/morestuff/javascript)
 
What do you mean by the URL? A URL (uniform resource locator) is used as a unique way of identifying pages - javascript doesn't come into it.

You can type javascript into the address bar and you can set javascript to run when you click a link if that's what you mean?
 
I mean that the link goes to a whole new page and automatically runs JavaScript on it.

That just sounds like programming to be done on the actual webpage..

The URL, is just the page 'identifier', it wont change the webpage, or make things happen, as it is, in effect, just a name.

mysite.org/morestuff/javascript

This would just take you to a different page within your site, not envoke any javascript (directly anyway)
 
You're trying to go about it the wrong way - if you want to modify the contents of a specific webpage via JS after loading, you're much better off writing a greasemonkey script.
 
Back
Top Bottom