Using bootstrap 3.0 modals to load dynamic, remote content within an iframe

后端 未结 5 1122
离开以前
离开以前 2020-12-08 07:57

I have tried several of the suggestions posted here on other questions and on stackexchange, and nothing is working to my satisfaction.

I am trying to load dynamic

5条回答
  •  被撕碎了的回忆
    2020-12-08 08:40

    Probably an old post, I had a similar problem a time ago, i wanted to press a link, which would pass the href of a text file (or any other file) to an iframe inside a modal window, i solved like this:

    function loadiframe(htmlHref) //load iframe
    {
    document.getElementById('targetiframe').src = htmlHref;
    }
    
    
    function unloadiframe() //just for the kicks of it
    {
    var frame = document.getElementById("targetiframe"),
    frameHTML = frame.contentDocument || frame.contentWindow.document;
    frameHTML.removeChild(frameDoc.documentElement);	
    }
    
    
    
    
    
    
    
    
    
    LINK
    
    
    
    
    

    So in this case you have only one modal, one iframe, which you load and unload.

提交回复
热议问题