Hi, I really need some help, I created an index page with a frameset of two columns, one is the menu and the other column is a thirdparty page url.I have a link in the menu to run a javascript code that highlights all the members of a friendslist in the thirdparty website (I'm making an addon service to this website to help people invite their friends, instead of clicking one by one this javascript code automatically highlights all the members on that page), Anyway when I'm in the thirdparties member list page and run the javascript directly in the browsers address bar it works fine, but when I do it through frameset/menu by click on the link inside the menus frame it doesn't work, I've been scratching my head for hours and can't seem to come up with anything, this is what I'm using: index.html <html> <HEAD> <TITLE>» </TITLE> </HEAD> <frameset cols="20%,80%" border="0" scrolling="no" > <frame src="menu.html" name="menu" /> <frame src="http://www.URLofThirdPartyForum.com/" name="main" /> </frameset> </html> HTML: menu.html <HEAD> <TITLE>» </TITLE> <style type="text/css"> body { background-color:#3b5998; } </style> </HEAD> <img src="fbpt.png"> <br />On every new page of friends, <u><a href="javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object'){fs.click(elms[fid]);}} " target="main">Click Here</a></u> to automatically highlight all your friends on that page. © <script type="text/javascript"> var theDate=new Date() document.write(theDate.getFullYear()) </script>. All rights reserved.</font> HTML: When I paste this code in the browsers address bar it works and highlights all the 'friends' in the members list page: javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object'){fs.click(elms[fid]);}} HTML: so surely it must be possible to run that same code inside a frame through the click of a link???
Browsers won't let you run javascript on other domains within a frame due to security issues. Depending on your situation you may be able to load the page using server-side scripting and then execute the javascript on that. e.g: <html><HEAD><TITLE>» </TITLE></HEAD><frameset cols="20%,80%" border="0" scrolling="no" > <frame src="menu.html" name="menu" /> <frame src="loadurl.aspx?url=http://www.URLofThirdPartyForum.com/" name="main" /></frameset></html> Code (markup): Where loadurl.aspx is an asp.net page that will load the remote page locally (you could use php/asp or any other server-side script). This can get a bit tricky in that referenced images/links etc. on the remote page will not work because they will try to find them on your server and not on the remote server. But as i said, it depends on what your purpose is. I hope all of that makes sense.