asp.net中的Jquery CDN问题 [英] Jquery CDN problem in asp.net

查看:55
本文介绍了asp.net中的Jquery CDN问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我制作了非常简单的aspx,没有母版页。我从CDN附加了jquery,然后从jquery站点复制/粘贴了jquery选项卡示例代码。然而它不起作用:



Hello,

I made very simple aspx without masterpage. I attached jquery from CDN and then copy/pasted jquery tab sample code from jquery site. It doesnt work however:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication12.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title></title>	
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>
		<script>
			$(function ()
			{
				$("#tabs").tabs();
			});
	</script>
</head>
<body>
	<form id="form1" runat="server">
	<div id="tabs">
		<ul>
			<li><a href="#tabs-1">Nunc tincidunt</a></li>
			<li><a href="#tabs-2">Proin dolor</a></li>
			<li><a href="#tabs-3">Aenean lacinia</a></li>
		</ul>
		<div id="tabs-1">
			<p>
				Proin elit </p>
		</div>
		<div id="tabs-2">
			<p>
				Morbi tincidunt, </p>
		</div>
		<div id="tabs-3">
			<p>
				Mauris eleifend </p>
		</div>
	</div>
	</form>
</body>
</html>





可能是什么原因?



What may be the reason?

推荐答案

(function()
{
(function () {


#tabs)。tabs();
});
< / script >
< / head >
< body > ;
< 表格 id = form1 runat = server >
< div id = 标签 >
< ul >
< li > < a href = #tabs-1 > Nunc tincidunt < / a > < / li >
< li > < /跨度> <跨度class =code-keyword>< a href = #tabs-2 > Proin dolor < / a > < / li >
< li > < a href = #tabs-3 > Aenean lacinia < / a > < / li >
< / ul >
< div id = tabs-1 >
< p >
Proin elit < / p >
< / div >
&升t; div id = tabs-2 >
< p >
Morbi tincidunt,< / p >
< / div >
< div id = 标签 - 3 >
< p >
Mauris eleifend < / p >
< / div >
< / div >
< < span class =code-leadattribute> / form >
< / body >
< / html >
("#tabs").tabs(); }); </script> </head> <body> <form id="form1" runat="server"> <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p> Proin elit </p> </div> <div id="tabs-2"> <p> Morbi tincidunt, </p> </div> <div id="tabs-3"> <p> Mauris eleifend </p> </div> </div> </form> </body> </html>





可能是什么原因?



What may be the reason?


你还没有包含 jQuery UI CSS 文件。试试这个:



You have not included the jQuery UI CSS file. Try this:

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>





1.首先包括jQuery UI css文件。

2.接下来是jQuery最新的js文件。

3.接下来是jQuery UI js文件。



希望这有帮助!



1. First include the jQuery UI css file.
2. Next the jQuery latest js file.
3. Next the jQuery UI js file.

Hope this helps!


这篇关于asp.net中的Jquery CDN问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆