Can the AJAX cross domain request limitation be bypassed by loading a JS file containing $.getJSON from the same server (domain) as the URL in the AJAX request? For example, if there is a webservice on serverA.com that needs to be accessed from pages on various domains like subdomain.serverA.com and serverB.com. The JS is hosted on serverA.com and included on different domains using an absolute URL:
<script src="http://serverA.com/ajax.js" />
And let's say the page URL is http://serverB.com/page.html
In this scenario, will
$.getJSON('http://serverA.com/service/',...
be able to bypass cross domain limitations?
In simpler terms, do browsers consider the page URL or the source URL of the JS when enforcing the same-origin policy for AJAX requests?