I am trying to load my wordpress based website with AJAX following this Tutorial. All of the code makes sence to me but they are using a plugin called JS Hashchange Event. The issue I am having is that in part it uses the $.browser.msie
so when I run it with jQuery 1.9 I get a Uncaught TypeError: Cannot read property 'msie' of undefined
error. I tried adding the js migrate plugin but it did not work. I read that I could add this bit of code
jQuery.browser={};(function(){jQuery.browser.msie=false;
jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)\./)){
jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();
but not sure where to put it. Anyone had this issue? Or maybe a better way to use AJAX with loading wordpress pages (keep the header and footer static)?
I am trying to load my wordpress based website with AJAX following this Tutorial. All of the code makes sence to me but they are using a plugin called JS Hashchange Event. The issue I am having is that in part it uses the $.browser.msie
so when I run it with jQuery 1.9 I get a Uncaught TypeError: Cannot read property 'msie' of undefined
error. I tried adding the js migrate plugin but it did not work. I read that I could add this bit of code
jQuery.browser={};(function(){jQuery.browser.msie=false;
jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)\./)){
jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();
but not sure where to put it. Anyone had this issue? Or maybe a better way to use AJAX with loading wordpress pages (keep the header and footer static)?
Share Improve this question asked Oct 23, 2013 at 0:12 PackyPacky 3,5839 gold badges56 silver badges90 bronze badges2 Answers
Reset to default 16The $.browser
has been removed as of jQuery 1.9.
Straight from the docs: $.browser
The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We remend using feature detection with a library such as Modernizr.
You can use the jQuery migrate plugin to restore removed functionality if needed. If it didn't work, you can try using Ben Alman's hashchange plugin, and replace $.browser.msie
with (document.documentMode != undefined)
.
There is an update of this script, Please refer the URL : https://github./georgekosmidis/jquery-hashchange
2013-29-11 fix: As of jQuery 1.9 $.browser used in Ben's code isn't supported anymore.