How exactly can I replace an iframe with a div and Javascript?

前端 未结 5 1938
再見小時候
再見小時候 2020-12-28 20:03

I have a page that loads an external HTML page into an iFrame. There are two problems I am facing with this:

  1. The iFrame is always a fixed height, but I want it
5条回答
  •  失恋的感觉
    2020-12-28 20:31

    I actually wrote up an answer to a different question, that seems to apply here: https://stackoverflow.com/a/10012302/166661

    You've got a server that will return to you information -- you could place this information in an IFRAME... or you can call a JavaScript function to retrieve that information and display it in a location (DIV) you set aside on your page.

    Here is a sample HTML page that will retrieve information from the server using AJAX

    
    
    
    
    
    
    

    AJAX Test

    Click a link... Area One Area Two Area Three

    Here is where the information will go.

     

    And here is the info.php that returns the information back to the HTML page:

    
    

    Hope this helps!

提交回复
热议问题