English 中文(简体)
Internet Explorer, How to change iframes src
原标题:

For some reasons I m using an Iframe to display googlemaps, when I want to change it s content I m just changing the Iframe src using JQuery.

$( #ggMap ).attr( src , http://newurl.com );

Apparently it s not doing anything on Internet Explorer.

Does anyone know how I could do the same thing with IE?

最佳回答

You can set the src of an IFrame with javascript, so I guess there is a script error preventing IE from working properly.

Have you debugged the script?

问题回答

Not sure about jQuery, but regular javascript would be something like:

document.getElementById( ggMap ).src =  http://newurl.com ;

I found that I had the same problem with IE8 and changing the src via jQuery/JS didn t work like this. What I now do is actually use jQuery.clone() to clone the iframe, then change it s src, then remove the original iframe and insert the clone...





相关问题
jQuery redirect not working in non-IE browsers

I m trying to redirect all links to a particular page on our site to a secure connection using jQuery. This code works fine in IE, but it doesn t work in any other browser (tried it in Chrome, Firefox,...

Browser-friendly way to simulate anchor click with jQuery?

I m trying to simulate a click on an anchor tag using jQuery. I ve been digging around StackOverflow and Google for a while and haven t found anything that works on all of the browsers I m testing. So ...

Widescreen check on normal screen

I work normal screen and I develop some web application. When the application goes on widescreen some of the pages looks weired. Is there any way I can view my web page as it looks in Widescreen on my ...

Cross-browser development

I m developing a web application for a new service, starting from Firefox 3.5. The interface design is tableless, only using divs + CSS & performance-blessed practices. Now, while being ...

热门标签