html-jquery/js Why can’t I see it or get 403 when referencing external images? This article mainly brings you an article to solve the problem that html-jquery/js encounters the problem that it cannot be seen or 403 appears when referencing external images. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Hope it helps everyone.
The solution is as follows:
<script type="text/javascript"> function showImg(url) { var frameid = 'frameimg' + Math.random(); window.img = '<img id="img" style="width: 100%;height: auto" src=\'' + url + '?' + Math.random() + '\' /><script>window.onload = function() { parent.document.getElementById(\'' + frameid + '\').height = document.getElementById(\'img\').height+\'px\'; }<' + '/script>'; document.write('<iframe id="' + frameid + '" src="javascript:parent.img;" frameBorder="0" scrolling="no" width="100%"></iframe>'); } </script> <p> <script type="text/javascript">showImg("图片url");</script> </p>
I have passed the test!
The above is all the content that the editor has brought to you to solve the problem that html-jquery/js encounters the problem of being unable to see or appearing 403 when referencing external images. I hope you like it~
Related recommendations:
How to load external images in php drawing, _PHP tutorial
Ask about the problem of using phpmailer to send external images in html format
How to load external images in php drawing
The above is the detailed content of Solution to the problem that html-jquery/js cannot see or appear 403 when referencing external images. For more information, please follow other related articles on the PHP Chinese website!