Link Details

Link 1101707 thumbnail
User 368782 avatar

By Martyr2
via coderslexicon.com
Published: Jan 27 2014 / 23:12

Want to use some content from another site on yours but JavaScript is being a jerk and throwing up the XMLHttpRequest Cannot Load security error? Here are a couple ways to tell JS to take a hike and get around it.
  • 6
  • 0
  • 398
  • 1033

Comments

Add your comment
User 776377 avatar

lburnham123 replied ago:

0 votes Vote down Vote up Reply

Another approach would be to add a SCRIPT tag and load its content using JSONP (in this case using the "callback" function). That reopens all the cans of security worms, but works even on browsers that don't support CORS.

User 776377 avatar

lburnham123 replied ago:

0 votes Vote down Vote up Reply

Despite what the text says, it's apparently not possible to post code in comments. #fail

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (6)



Voters Against This Link (0)



    Java Performance Optimization
    Written by: Pierre-Hugues Charbonneau
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Node.js
    2. Debugging JavaScript
    3. OO JS
    4. JSON
    5. Ajax