简体   繁体   中英

Javascript error XMLHttpRequest cannot load

Im currently working on an online-shop(System is Gambio) and I got Pop-Up images in a lightbox. But it doesn't work when Im trying to open the pictures.

In Chrome console I got the error messages:

XMLHttpRequest cannot load http://zoobedarfxxl.de/request_port.php?module=Attributes&action=attribute_images&options_ids=&values_ids= . Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore not allowed access.

and

XMLHttpRequest cannot load h.ttp://zoobedarfxxl.de/request_port.php?module=LightboxGallery&id=15066&XTCsid=565bb63ec1814f33dccf6af1c422c1f4. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore not allowed access.

and

VM5415:1 Uncaught TypeError: Cannot read property 'replace' of undefinedButtonProductImagesHandler.gallery_init_binds
@ VM5415:1(anonymous function) @ VM5415:1n.extend.each 
@ gm_javascript.js.php?cPath=8577&products_id=15066&XTCsid=565bb63…&XTCsid_na…:8n.fn.n.each @ gm_javascript.js.php?cPath=8577&products_id=15066&XTCsid=565bb63…&XTCsid_na…:8(anonymous function) 
@ gm_javascript.js.php?cPath=8577&products_id=15066&XTCsid=565bb63…&XTCsid_na…:10j @ gm_javascript.js.php?cPath=8577&products_id=15066&XTCsid=565bb63…&XTCsid_na…:8k.fireWith 
@ gm_javascript.js.php?cPath=8577&products_id=15066&XTCsid=565bb63…&XTCsid_na…:8x @ gm_javascript.js.php?cPath=8577&products_id=15066&XTCsid=565bb63…&XTCsid_na…:10b 
@ gm_javascript.js.php?cPath=8577&products_id=15066&XTCsid=565bb63…&XTCsid_na…:10

I searched the problem a little bit, but I was not able to figure how to solve the problem. Has anyone some Hints oder Ideas how to solve this?

Greetings Tim

You are getting a CORS (Cross Origin Resource Sharing) issue. Have a look on StackOverflow questions with CORS tag.

For security reasons, browsers restrict cross-origin HTTP requests initiated from within scripts.

There are restrictions while making ajax request to the server other than the document's domain.

The reason of error is " Access-Control-Allow-Origin " header is not supplied by other server.

Resources:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM