pjknight
pjknight

Reputation: 130

AJAX on mobile website

I have a mobile website and I want to track clicks via javascript/ajax.

I thought I could use jquery to send the the tracking information and when I get a successful return I can redirect the user appropriately. I could do this no problem but I don't want to use jquery as it's a small webpage, loading in a JS library seems over the top.

What's the best way to post a http request? It needs to work on all modern smart phone web browsers.

Cheers

Upvotes: 0

Views: 247

Answers (1)

zybroxz
zybroxz

Reputation: 713

jquery-1.7.2.min.js is only 93kb and has all XHR functionality pre rolled and should work in all browsers.

Otherwise you would need to hand bake your own XHR's and take browsers into consideration

for example FF, Chrome and Safari can fire up new XMLHttpRequest objects, but IE will need a new ActiveXObject("Microsoft.XMLHTTP")

Upvotes: 1

Related Questions