JS error when a linked page has jQuery mobile tabs and navbar widget

亡梦爱人 提交于 2019-12-19 11:48:11

问题


{{ See demo }}

Page 1 is a jquery mobile page.

Page 2 is a page with jquery mobile tabs and navbar widget.

Page 3 is a page without jquery mobile tabs and navbar widget.

The only structural difference between 2 and 3 is the presence of data-role=tabs.


A) When each of them are run as is (you type the url on address bar), everything is fine.

B) When you click from page 1 to page 2,

i) js error: Uncaught SyntaxError: Unexpected token < VM10189 jquery-1.11.1.min.js:2

ii) the code outside <page/> on page 2 is run, as you see the alert.

C) When you click from page 1 to page 3, everything is fine (no js error, code outside <page/> not run).

What is wrong?


回答1:


Somebody gave an answer on the same question asked elsewhere. I checked it working. Look for

$.widget( "ui.tabs", $.ui.tabs, {
....


来源:https://stackoverflow.com/questions/27167311/js-error-when-a-linked-page-has-jquery-mobile-tabs-and-navbar-widget

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!