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>
as can see screen shot there 2 jquery script request data.html. how avoid these unwanted request server?
Comments
Post a Comment