Observer.observe(document.getElementById('divmap'), observerConfig) ĭoes any one know how to solve this problem, any instruction is highly appreciated, thanks a lot. To allow the browser to send a request to your Node.js server from a different origin (domain), you will need to include the appropriate CORS (Cross-Origin. Start observing the target node (divmap) and the specified configuration The Access-Control-Allow-Origin header (ACAO) enables a server to dictate which origins can use scripts to access that servers resources. Var observer = new MutationObserver(handleMutations) Create a new MutationObserver with the callback function For IIS6 Open Internet Information Service (IIS) Manager Right click the site you want to enable CORS for and go to Properties Change to the HTTP Headers tab. You can also allow any by setting the Allow-Origin to when using express.js cors. Has been blocked by cors policy: no access-control-allow-origin header is present on the requested resource. $(mutation.addedNodes).filter('img').attr("crossorigin", "true") In a production scenario, the Allow-Origin would be actual domain names that you want to allow. So I use following codes to catch event before image loading data, but it is still invalid. The Error message show Īnd I found the image element not insert into map object, it is reject when fetching then throw the error. The CORS Policy Enables Cross-origin resource sharing (CORS) in Express Gateway.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |