PDA

View Full Version : Can I pass the name of a Javascript function to a page opened with an href



Peter Cadogan
May 26th, 2007, 06:20 PM
I'm not sure whether or not this is possible, but I want to have control over the Javascript function that is called when a target web page is opened (ie as the onload function in its <body> tag). In other words, the calling page will have several <a href ...> tags referencing the same page, each specifying a different onload function. Is it possible to effectively pass a parameter in this way? I have not been able to find any solution to this.

_Aerospace_Eng_
May 26th, 2007, 06:23 PM
That depends. Are the links you are opening links to other websites or your own website?

Arty Effem
May 27th, 2007, 12:02 AM
I'm not sure whether or not this is possible, but I want to have control over the Javascript function that is called when a target web page is opened (ie as the onload function in its <body> tag). In other words, the calling page will have several <a href ...> tags referencing the same page, each specifying a different onload function. Is it possible to effectively pass a parameter in this way? I have not been able to find any solution to this.It's perfectly possible and it can work cross-domain, provided that the target page contains code to read the parameter that it receives. Are you in a position to implement this?