简体   繁体   中英

include html file from another website?

I tried this but it does not work form other website

<script src="https://code.jquery.com/jquery-1.10.2.js"></script>    
<script> 
    $(function(){
      $("#includedContent").load("https://mywebsite.com/file.html"); 
    });
</script>

and

    <div id="includedContent"></div>

you must use iframe tag to load the html page. iframe is the tag which you can use for call other html pages into your web page

<iframe src="http://www.google.co.in" name="targetframe" allowTransparency="true" scrolling="no" frameborder="0" >
    </iframe>

Try this:

<iframe src="https://www.my website.com/file.html"></iframe>

If this doesn't work, just comment on this answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM