Make chrome support cross-domain access

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.