From the course: Learning JavaScript Debugging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Why debugging AJAX can be tricky

Why debugging AJAX can be tricky - JavaScript Tutorial

From the course: Learning JavaScript Debugging

Start my 1-month free trial

Why debugging AJAX can be tricky

- [Instructor] When you're getting started debugging projects involving AJAX, where your code is loading data dynamically, you might start to run into some trouble. Let's talk a little bit about what kinds of issues you might see and how to deal with them. There are a couple of main families of security issues you can expect to see at first. We're not gonna get super specific about what these are right now. I just want to make you aware of what you might you see. First is the same-origin policy. In a nutshell, this means that all of your assets and data need to come from the same place, the same place being sort of like the same server. Then there's CORS which is access control for sharing data across domains basically. If you just take an example HTML file from the exercise files in this course, for example, and drop it into your browser, it'll be loaded with a file URL that looks like this. If you try to load data from another file or from the web from the scripts in that file…

Contents