In background development, the IFRAME framework was used. The background page is as follows:
<div style="width:185px; overflow:hidden;"Id="West"data-options="Region : ' West ', Split:true,title: ' function menu '"> <divclass="easyui-accordion"fit="true"Border="false"> <iframe name="Leftframe"Id="Leftframe"Width="100%"height="100%"scrolling="Yes"Frameborder="NO"style="width:100%;background-color:transparent;"allowtransparency="true"></iframe> </div></div><div id="Mainpanle"region="Center"style="background: #eee; overflow:hidden; z-index:10 ;"> <!--Height: -%;--> <div id="Tabs" class="Easyui-tabs"fit="true"Border="false"> <!--style="height:100%;"-<div title="Welcome to use"style="text-align:center;width:100%;height:100%;vertical-align:middle; text-align:center;"Id="Home"> <iframe name="MainFrame"scrolling="Auto"height="99%"Width="100%"Frameborder="0"src="welcome.html"></iframe> </div> </div></div>
Menu page opens in Leftframe, click on the menu to invoke the parent page of a JS method:
Window.parent.addTab (Menuid,menuname,url);
The above code is published to the server access is not a problem, but the local file path execution will be error:
This is designed to be a cross-domain access issue, if it is not to be accessed locally, this is the chrome parameter.
1. Open Chrome shortcuts, properties
2. Add at the end:
--args--disable-web-security
3. Restart the browser
Make chrome support cross-domain access