BlackBerry WebWorks and the same origin policy
Say you’re coding a website, and you need to grab a section (perhaps a specific ID) of an external website to display on your site, via AJAX. You can’t just grab the page via AJAX because it violates the same origin policy, which states that you can only grab pages on your own domain.
As a workaround, people usually create a serverside proxy of the remote site. So if you’re working on example1.com, and you need the #content section of a page on example2.com, you’d create example1.com/example2 (or whatever you want to name it) which would just be a clone of example2.com. Then you’d be free to do whatever you want to it via AJAX, since it’s on your domain.
I was working on a BlackBerry WebWorks project recently, and needed to make an AJAX request to a website, and since with WebWorks you’re limited to HTML/CSS/JS and you’re not actually working on a website (but rather an app), the serverside proxy is impossible.
Luckily, even though the docs glazed over this point, you can add trusted domains in your app’s config file, and any domains in that list ignore the same origin policy. So you’re free to make any and all AJAX requests you want to any domain in your list. Just wanted to point that out since I learned it the hard way.