So I have a few questions. The first is I am trying to load a page into a website and I can get it to work doing this:
First problem is that I need to keep reloading the page; however, it saves the page. I am assuming it is from the cache. Is there a way to stop that?Code:$(document).on({ click:function(){ $(this).hide() loadObject() //setInterval(loadObj, 3000); } },'#loadItem') function loadObject(){ $.get( "../Gabe%20and%20Our%20Website/index.html", function( data ) { var area = '../Gabe%20and%20Our%20Website/' var head_start = data.indexOf('</title>')+("</title".length+1) var head_end = data.indexOf('</head>') var head_html = data.substring(head_start, head_end); head_html = head_html.replace(/src="+/g, 'src="'+area+''); head_html = head_html.replace(/href="+/g, 'href="'+area+''); var body_start = data.indexOf('<body>')+('<body>'.length+1) var body_end = data.indexOf('</body>') var body_html = data.substring(body_start, body_end) $( "#loader" ).html(head_html+body_html); }); }
Also I cant get my setInterval to work once i click on #loadItem. Any ideas?



Reply With Quote
Bookmarks