代码改变世界

JQuery智能感应

2010-01-22 19:15  三皮开发时  阅读(307)  评论(0编辑  收藏  举报

学JQuery的路上....

在学JQuery UI 时 需要

jquery-ui-all-min-lastest.js (UI控件的JS代码需调用)文件

&&

jquery-min-lastest.js(压缩后的jQuery类库)文件

&&

jquery-1.3.2-vsdoc.js(JQuery在vs2008上智能感应)文件

问题:在使用时,调用前两个文件 再调用智能感应文件会失效

解决:

collapsible .aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class development_demos_accordion_collapsible : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public class WebConfig
    {
        public static string ResourceServer = @"http://localhost/MyWeb";

    }
}
---------

collapsible .aspx

<head runat="server">
    <title></title>
    <link href="http://www.cnblogs.com/../themes/dot-luv/style.css" rel="stylesheet" type="text/css" />
 
 
    <script type="text/javascript"   src="<%=WebConfig.ResourceServer %>/jquery-min-lastest.js"></script>   
    <script src="<%=WebConfig.ResourceServer %>/jquery-ui-all-min-lastest.js"
        type="text/javascript">
    </script>
        <%
    if (false)
       {
  %>

    <script src="http://www.cnblogs.com/jquery-1.3.2-vsdoc.js" type="text/javascript"></script>
    <%
      }
     %>
   
    <link href="../demos.css" rel="stylesheet" type="text/css" />
   
   
            <script type="text/javascript">
                $(function() {
                $("#accordion").accordion();
                   
                });
 </script>
</head>

这样 $就有感知了   YES!

public static string ResourceServer = @"http://localhost/MyWeb";

说明下,这个方法还不错, 参考高人方法 他引用的是网站地址 http://www.dotnetapi.com/jslib/ 感兴趣的可以去这里下好东西...

而这里利用的是IIS 在网站下建虚拟目录获取地址来调用相关文件 src="<%=WebConfig.ResourceServer %>/jquery-min-lastest.js" 已这种方式拼起来.

 

3Q张子秋代码

3Q森戳指导.(IIS)