Twitter bootstrap modal external urls are not working

前端 未结 3 1101
[愿得一人]
[愿得一人] 2020-12-14 12:10

Twitter bootstrap modal doesn\'t load external urls inside modal.

Sample Code : jsFiddle



        
3条回答
  •  庸人自扰
    2020-12-14 12:43

    This doesn't work because you are violating the same origin policy restriction that prevents you from sending cross domain AJAX requests which is what bootstrap is using here. So one possibility is to load the external content into an '); });​

    Be warned though that some sites (such as google, stackoverflow, facebook, ...) cannot be loaded into an iframe. They are setting the X-Frame-Options response HTTP header to SAMEORIGIN and also check if they are loaded inside an iframe.

    You can see it in action in this fiddle: http://jsfiddle.net/f2Fcd/

提交回复
热议问题