链接页面具有jQuery移动选项卡和导航栏小部件时出现JS错误

编程入门 行业动态 更新时间:2024-10-12 20:21:53
本文介绍了链接页面具有jQuery移动选项卡和导航栏小部件时出现JS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

{{参见演示}}

第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错误

本文发布于:2023-11-02 03:46:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551282.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:部件   选项卡   错误   页面   链接

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!