Link to home
Start Free TrialLog in
Avatar of Terry Woods
Terry WoodsFlag for New Zealand

asked on

How to load a 3rd party URL from JQuery for tracking

I need to trigger the loading of a 3rd party URL when a JQuery event is triggered. The service I'm using suggests just including a tag like this:
<script src=\"http://exampletrackingservice.com/track?C=82374&source=js\" type=\"text/javascript\"></script>

Open in new window

But that of course gets loaded on the page load rather than when the event is triggered. I tried using a $.get call but got the error:
MLHttpRequest cannot load http://exampletrackingservice.com/track?C=82374&source=js. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mysite.com' is therefore not allowed access. 

Open in new window

I don't need to get any data from the URL; I just need to load it. How can I do that from JQuery?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Terry Woods

ASKER

Your amazing lightning fast response seems to work too... awesome, thanks!
'welcome