代码一:
<div id="mainContent"> <iframe id="contentContainer" name="mainFrame" width="100%" frameborder="0" scrolling="auto" height="700" src=""> </iframe> </div>
代码二:
function refreshMainContent(url,path,showLoading,language,locale) { var action=url; if(url.indexOf('{')==0&&url.lastIndexOf('}')==url.length-1){ } var mainContent = document.getElementById("mainContent"); if (mainContent) { // Remove iframe in mainContent var jqIframe = jQuery('#mainContent').find("iframe"); jqIframe.attr("src", "about:blank"); try{//Try is for sub-window access deny(security problem). jqIframe.contents().each(function() {//Prevent Memory Leak this.write(""); }); }catch(e){} jqIframe.remove(); mainContent.innerHTML = ""; } jQuery("#mainContent").load(action,"",function(){ }); return false; }