Changed to used XDomainRequest only when url is cross domain

Can you please test that this still works in your use case, and if it does, accept this pull request. Thanks!

-heff