www.webdeveloper.com
Results 1 to 4 of 4

Thread: [RESOLVED] Iframe and firefox

  1. #1
    Join Date
    Sep 2011
    Posts
    2

    resolved [RESOLVED] Iframe and firefox

    Hello,

    I have a an Iframe in my html code like this;
    <iframe id="degiskenicerik" scrolling="yes" src="http://localhost:16413/ZikriSinoglu/Idari.htm" frameborder=0 name="degiskenicerik"></iframe>

    And i want to change its src property with following script;

    function menu_click(url) {
    document.getElementById('degiskenicerik').src = url;
    document.getElementById('degiskenicerik').style.visibility = "visible";
    }
    It works in IE and Chrome, but wont work in Firefox.

    Please Help,

    Thanks.

  2. #2
    Join Date
    Nov 2010
    Posts
    1,086
    maybe this will help:

    Code:
    changeIframeSrc("degiskenicerik");
    
    
    function changeIframeSrc(id) {
    var el = document.getElementById(id); 
        if (el && el.src) {
            el.src = document.getElementById('degiskenicerik').value;
    	el.style.visibility = "visible";
            return false;
        }
        return true;
    }

  3. #3
    Join Date
    Sep 2011
    Posts
    2

    resolved Solved

    Thank you so much,

    I changed my code through your answer.

    function menu_click(url) {
    var el = document.getElementById('degiskenicerik');
    el.src = url;
    }

    it works in firefox now. Bu i cant understand, what could be the reason of this?

  4. #4
    Join Date
    May 2013
    Posts
    2
    I would like to thank "xelawho" to provide the solutions. Worked for me I was really messing with the same from long thanks alot.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles