Cross-Domain Configuration of proxy in Javascript by ESRI

Source: Internet
Author: User

The previous few days, we made a function to query within the specified range on the map. Because the transmission parameter is a polygon, the number of ur points exceeds the allowed transmission standard. After the query, ESRI has already taken this issue into consideration for you. You can directly download the Javascript proxy on the Internet as a proxy.

However, after use, it is found that although everything is correctly configured, localhost: XXX // is not allowed by access-control-allow-origin is displayed. the problem is that a lot of information is queried and cross-domain problems are found.

Many of the Google search recommendations have not been solved. Finally, in an article about cross-OriginArticleHave a good understanding of the relevant information.

Therefore, you can solve the problem by adding the following two HTTP Response Headers in Web. config or IIS:

1. Name: access-control-allow-Origin

Value :*

2. Name: access-control-allow-headers

Value: X-requested-

 

So I can finally access the proxy query page. Although I finally gave up this method because the IP address does not automatically switch, it solved the cross-domain problem after all. Write down to help yourself and others.

Related Article

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.