Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/463.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用javascript控件选项卡页面?_Javascript_Jquery_Jquery Mobile - Fatal编程技术网

如何使用javascript控件选项卡页面?

如何使用javascript控件选项卡页面?,javascript,jquery,jquery-mobile,Javascript,Jquery,Jquery Mobile,我创建了2页。一个叫做home.html,它链接到products.html。当我测试这个时,我打开home.html,并按照链接到products.html。但是products.html中的javascript不起作用(参见下面的代码) 这是products.html: 第1页 内容1 第2页 内容2 第3页 内容3 多亏了用户ali carikcioglu,现在可以在上使用小提琴了 有人能给我解释一下为什么这不起作用吗?从您在products.htm

我创建了2页。一个叫做
home.html
,它链接到
products.html
。当我测试这个时,我打开
home.html
,并按照链接到
products.html
。但是
products.html
中的javascript不起作用(参见下面的代码)

这是
products.html


第1页
内容1
第2页 内容2
第3页 内容3

多亏了用户ali carikcioglu,现在可以在上使用小提琴了


有人能给我解释一下为什么这不起作用吗?

从您在products.html中使用jQuery Mobile的外观来看。由于您发布的fiddle都指向同一个对象,并且其中没有适当的html/js,我只能假设您遇到的问题是您没有将products.html指向jQuery和jQuery移动源

把这个加到你的头上

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>



可能是学习如何使用框架的好地方

css和jquery代码在哪里?我使用jquery。你能帮我用javascript创建标签页控件吗?这是你网站的实时演示吗?你甚至都懒得为此创建一个JSFIDLE演示?我给你-1。这是home.html:这是products.html:
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>