zoukankan      html  css  js  c++  java
  • jQuery UI dialog插件出错信息:$(this).dialog is not a function

    使用jQuery UI 1.7.2 dialog插件,遇到这样的错误:
    [img]http://dl.iteye.com/upload/attachment/308166/97c428e4-2ce2-367e-b4df-4c4da7686b95.bmp" alt="" width="210" height="44[/img]

        $("#dialog").dialog({  
             480,  
            height:"auto",  
            resizable: false,  
            draggable: true,  
            modal: true,  
            position: "center",  
            autoOpen: false,  
            dialogClass: "dialog",  
            buttons: {"关闭":function(){  
            $(this).dialog("close");  
            }}  
        });  
          
        $("#chglogpwd").bind("click",function(){  
            $("#dialog").dialog("option","height","400");  
            showModalDialog("#dialog","/accoun/acc/change_logpwd_fm.html?"+new Date().getTime(),"修改登录密码");  
                    });  
          
        function showModalDialog(dialogEl,url,title,callback){  
            var $this = $(dialogEl);  
            $this.html("");  
            $this.dialog("option","title",title);  
            $this.dialog("open");  
            $this.load(url).removeClass("hideh");  
        } 
    调试了很久,发现在当前页面上加载了jquery的js资源,在被load的那个页面中也加载了jquery的资源。
    <script type="text/javascript" src="/common/js/jquery-1.4.2.min.js"></script>
    尝试将被load的页面中的jquery资源去除,错误便消除。

    经测试:asp.net mvc 1.0/2.0不会出现此错误,但是mvc 3.0中就会出现此错误

  • 相关阅读:
    linux/eclipse/c++ 动态库的创立与调用
    虚拟机NetworkAdapter三种方式的区别
    关于“三层架构”和MVC
    C# 扩展方法
    鼠标拖移对象
    获取应用程序根目录物理路径(Web and Windows)
    一个简单的管理Web站点文件的页面程序(修改版)
    一个基于jQuery的简单树形菜单
    以人为本的程序的设计
    一个加密解密的小工具及源码(MD5, DES, RSA)
  • 原文地址:https://www.cnblogs.com/guanjie20/p/2466757.html
Copyright © 2011-2022 走看看