Home > Web Front-end > JS Tutorial > body text

Solution to the problem that html-jquery/js cannot see or appear 403 when referencing external images

小云云
Release: 2017-12-27 11:43:16
Original
1628 people have browsed it

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=\&#39;&#39; + url + &#39;?&#39; + Math.random() + &#39;\&#39; /><script>window.onload = function() { parent.document.getElementById(\'' + frameid + '\').height = document.getElementById(\'img\').height+\'px\'; }<&#39; + &#39;/script>';
   document.write('<iframe id="&#39; + frameid + &#39;" src="javascript:parent.img;" frameBorder="0" scrolling="no" width="100%"></iframe>');
   }
</script>

<p>
 <script type="text/javascript">showImg("图片url");</script>
</p>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!