Answer the question
In order to leave comments, you need to log in
How to implement in JS an analogue of include HTML code in IE from a LOCAL file (file:///)?
Hello.
I'm trying to dynamically include content from an HTML file into the main page on IE locally .
What I have already tried:
1. $('#mainmenu').load("mainmenu.html");
2.
function getXmlString(xml) {
if (window.ActiveXObject) { return xml.xml; }
return new XMLSerializer().serializeToString(xml);
}
$.get( "mainmenu.html", function( data ) {
$('#mainmenu').html(getXmlString(data));
});
Answer the question
In order to leave comments, you need to log in
<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js">
</script>
</head>
<body>
<div id="load_div">111</div>
<input type='file'>
</body>
<script>
input = document.querySelector('input');
input.onchange = function() {
f = window.URL.createObjectURL(this.files[0]);
auto_refresh = setInterval(function() {
// $.ajaxSetup ({cache: false});
$('#load_div').fadeOut('slow').load(f).fadeIn("slow");
}, 500);
}
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question