Programming and more

Entries Tagged ‘jquery mobile’

How to make google analytics work with jquery mobile site

Google analytics doesn’t work with jquery mobile websites. Luckily, I found the way to make this work. Basically you have to break the code into 2 parts:     <script> var _gaq = _gaq || []; _gaq.push([’_setAccount’, ‘UA-xxxxxx-xx’]);   (function() { var ga = document.createElement(’script’); ga.type = ‘text/javascript’; ga.async = true; ga.src = (’https:’ == […]

jQuery Mobile 1.2.0 – How to disable the ajax loading and effects (and show adsense on jquery mobile!)

I had this problem, I wanted to add adsense advertisments to one of my mobile sites, but you can’t see the ads if the page loads with ajax. So I needed to disable it. The first solution was this: <script language="javascript">   $.mobile.ajaxLinksEnabled = false;   </script><script language="javascript"> $.mobile.ajaxLinksEnabled = false; </script> But after updating […]