The situation is as follows - there is a page A.aspx which has a hyperlink to another page B.aspx I want to run some javascript after someone clicks on the hyperlink in A.aspx and after B.aspx loads BUT I do not want to manually add this javascript to B.aspx?
The background for this is as follows- In a sharepoint site collection all the pages use a masterpage but there can be some pages which are standalone and these don't use a masterpage. The task is to add javascript to every page in the site (standalone as well as regular). So I added this javascript to the masterpage but since these standalone pages don't use the masterpage, they are not loading the javascript. The situation is that some regular sharepoint pages have hyperlinks pointing to these standalone pages, so when someone clicks on the hyperlink on the regular sharepoint page the standalone page gets loaded. Since there are quite a lot of standalone pages and I don't want to touch them, I am thinking if there is any way to execute javascript on these pages after they load (as a result of a user clicking the hyperlink on the regular sharepoint page) ?
B.aspxhas to load that script by itself. However if both pages have the same domain andB.aspxis opened viawindow.openthen you can indeed execute scripts inB.aspxfromA.aspx.