开发者

How to replace deprecated function in jQuery Mobile - updateHash

开发者 https://www.devze.com 2023-04-13 04:40 出处:网络
I tried updating from jQuery Mobile Beta 2 to rc1. Chro开发者_开发问答me gives me the following error:

I tried updating from jQuery Mobile Beta 2 to rc1.

Chro开发者_开发问答me gives me the following error:

Uncaught TypeError: Object # has no method 'updateHash'

I am using changeHash like this:

$.mobile.changePage(page);
$.mobile.updateHash(page, true);

The function seems to be removed since Beta 3. Which function can replace its functionality?


This is now an argument to the method $.mobile.changePage():

changeHash (boolean, default: true) Decides if the hash in the location bar should be updated.

So your code should be updated to:

$.mobile.changePage(page, { changeHash: true });

Source: http://jquerymobile.com/demos/1.0rc1/docs/api/methods.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号