Changing src of iframes in Firefox

Hello, I have a problem at my site. My javascript function for changing src of iframe does work in Opera, but it doesnt work in firefox or IE. Can anybody help me out, please?

I tried several ways, and now i have no other way, just ask.

function showMap(srcs, ine, ind, link){
if(document.getElementById(ind).style.display == ‘table-row’){
document.getElementById(ind).style.visibility = ‘hidden’;
document.getElementById(ind).style.display = ‘none’;
}else{
if (document.getElementById(srcs).src==‘’){
document.getElementById(srcs).src = link;
document.getElementById(srcs).location = link; // tried this
document.getElementById(srcs).location.href = link; // tried this too

}
document.getElementById(ind).style.visibility = ‘visible’;
document.getElementById(ind).style.display = ‘table-row’;
}
}

at the start, src is set “” //empty string

That first line in red should in theory work.

Can you link to a demo page that demonstrates the problem?

You can see that on this page: http://nasilekari.sk/test/?search=novotny

the map should appear, when you click on “Zobrazit mapu”

Hmm, it works for me in Chrome.

It seems that when you are retrieving the src attribute for the iframe, even though the iframe contains an empty string for the source, Firefox and Internet Explorer are returning the current web page address instead.

if (document.getElementById(srcs).src==‘’){

Try comparing it instead with the link that is given to the function, to see if the two are different.

thanks a lot :slight_smile: it works fine, i will upload it tommorow there. :slight_smile: