{{参见演示}}
第1页是一个jQuery移动页.
Page 1 is a jquery mobile page.
第2页是带有 jquery移动标签和导航栏小部件的页面.
Page 2 is a page with jquery mobile tabs and navbar widget.
第3页是没有 jQuery移动标签和导航栏小部件的页面.
Page 3 is a page without jquery mobile tabs and navbar widget.
2和3之间的唯一结构差异是data-role = tabs的存在.
The only structural difference between 2 and 3 is the presence of data-role=tabs.
A)当它们中的每一个都按原样运行时(您在地址栏上输入url),一切都很好.
A) When each of them are run as is (you type the url on address bar), everything is fine.
B)当您从第1页单击第2页时,
B) When you click from page 1 to page 2,
i)js错误:Uncaught SyntaxError: Unexpected token < VM10189 jquery-1.11.1.min.js:2
ii)运行第二页上的代码外部 <page/>,如您所见,警报.
ii) the code outside <page/> on page 2 is run, as you see the alert.
C)当您从第1页单击第3页时,一切都很好(没有js错误,<page/>之外的代码未运行).
C) When you click from page 1 to page 3, everything is fine (no js error, code outside <page/> not run).
怎么了?
推荐答案有人给一个答案在其他地方问过的相同问题.我检查了它的工作情况.寻找
Somebody gave an answer on the same question asked elsewhere. I checked it working. Look for
$.widget( "ui.tabs", $.ui.tabs, { ....更多推荐
链接页面具有jQuery移动选项卡和导航栏小部件时出现JS错误
发布评论