mikey3521 Posted December 12, 2008 Share Posted December 12, 2008 Okey I have a website abc.com, abc.com has an iframe that loads up a plug-in from xyz.com Yes I know Iframes are bad lol moving on. Now that IFRAME content has to pass a var into a text box on abc, so the iframe loads this script which is on abc.com: now this works fine in FF but not IE, any thoughts? When you click it in IE it dosn't pass it to the text input box, it just does nothing, show's no errors.. <html> <head> <script language="JavaScript" type="text/javascript"> function sendpb() { parent.parent.insert_text(getParameter(document.location.href, "url")); }; function getParameter ( queryString, parameterName ) { var parameterName = parameterName + "="; if ( queryString.length > 0 ) { begin = queryString.indexOf ( parameterName ); if ( begin != -1 ) { begin += parameterName.length; end = queryString.indexOf ( "&" , begin ); if ( end == -1 ) { end = queryString.length } return unescape ( queryString.substring ( begin, end ) ); } return ""; } } </script> </head> <body onload = "sendpb();"></body> </html> Quote Link to comment Share on other sites More sharing options...
mikey3521 Posted December 12, 2008 Author Share Posted December 12, 2008 Apparently now this is also not working for some FF users. What I'm trying to accomplish is I am using the Photobucket media plugin on a forum I run. I've embeded it in an IFRAME so when people are making post's they can just log in, select there image and hit add... when they hit "add" it calls the script above and attaches the URL to the image. which then gets inserted into the text box. It workes fine for me and many others. a small percentage of IE & FF users are having difficulties. So now it's not just an IE problem. Is there a better way to write this code. Quote Link to comment Share on other sites More sharing options...
webster08 Posted December 12, 2008 Share Posted December 12, 2008 I would be surprised if you get it to work in either browser. Most browsers have either a built in or at least updated security patch; that prevents you from cross domaining with an iframe (unless your using a proxy from there website). You could use PHP to get the pages content with file_get_contents() and then do it this way; to get your plugins (maybe). Quote Link to comment Share on other sites More sharing options...
mikey3521 Posted December 12, 2008 Author Share Posted December 12, 2008 Wouldn't this not fall under that category though? because the IFRAME has xyz.com open but when you click "add" it calls a script on abc.com... so in the end the iframe is abc.com and the site is abc.com... one of the users reported this from the error console. Error: Permission denied to get property Window.insert_text Source File: http://****.com/photocallback. ... %5B/IMG%5D Line: 6 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.