jquery - Changing Iframe src in Ajax success call - Web server will Get source references twice -


i have html page iframe element , when tried set iframe source after getting information through ajax call, multiple request source references server.

iframe.html:

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head>     <script src="jquery-2.1.4.min.js"></script>     <script src="bigfile.js"></script> // 3mb size </head> <body>     <iframe id="samplefile"></iframe>     <script type="text/javascript">          $.ajax({         type: "get",         url: my_url,         contenttype: "application/json; charset=utf-8",         datatype: "json",         success: function (data) {             $("#samplefile").attr("src", "data.html");         }         });          </script> </body> </html> 

data.html:

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head>     <script src="jquery-2.1.4.min.js"></script>     </head> <body>     content     </body> </html> 

screen shot: enter image description here

as can see screen shot there 2 jquery script request data.html. how avoid these unwanted request server?


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -