Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.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 Jquery对话框不是一个函数_Javascript_Jquery_Dialog - Fatal编程技术网

Javascript Jquery对话框不是一个函数

Javascript Jquery对话框不是一个函数,javascript,jquery,dialog,Javascript,Jquery,Dialog,我试图在我的应用程序中使用jquery对话框,但它不起作用,它说TypeError:$(…)。对话框不是来自mozilla控制台的函数,这是我的代码 <link rel="stylesheet" href="css/jquery-ui.css"> <script src="js/jquery.js"></script> <script src="js/jquery-ui.js"></script> <div id="dial

我试图在我的应用程序中使用jquery对话框,但它不起作用,它说TypeError:$(…)。对话框不是来自mozilla控制台的函数,这是我的代码

<link rel="stylesheet" href="css/jquery-ui.css">
<script src="js/jquery.js"></script>
<script src="js/jquery-ui.js"></script>



<div id="dialog-message" title="Important information">
    <div style="margin-left: 23px;">
        <p>
            We're closed during the winter holiday from 21st of December, 2010 until 10th of January 2011.
        </p></div>
</div>

<script >
    $(function() {

        $("#dialog-message").dialog({
            modal: true,
            draggable: false,
            resizable: false,
            position: ['center', 'center'],
            width: 500,
            height: 250,
            dialogClass: 'ui-dialog-osx',
            buttons: {
                "I've read and understand this": function() {
                    $(this).dialog("close");
                }
            }
        });

    });
</script>


我们在2010年12月21日至2011年1月10日的寒假期间休息。

$(函数(){ $(“#对话框消息”).dialog({ 莫代尔:是的, 可拖动:错误, 可调整大小:false, 位置:[“中心”,“中心”], 宽度:500, 身高:250, dialogClass:'ui dialog osx', 按钮:{ “我已经阅读并理解了这个”:函数(){ $(此).dialog(“关闭”); } } }); });
我正在开发一个使用其他javascript库的应用程序,为了避免冲突,我在使用jquery文件之后放置了对话框脚本,但仍然存在相同的问题。可能有什么问题???

请确认:

  • jquery-ui.js是通过Web服务器(http)运行应用程序加载的。在“网络”选项卡下的Firefox本机调试器中或在“网络”选项卡下的Firebug中

  • 并验证jquery-ui.js是否具有“dialog”模块

  • 请确认:

  • jquery-ui.js是通过Web服务器(http)运行应用程序加载的。在“网络”选项卡下的Firefox本机调试器中或在“网络”选项卡下的Firebug中

  • 并验证jquery-ui.js是否具有“dialog”模块


  • 由于大多数javascript库都使用美元符号$来操作它们的函数,包括不同的javascript生成冲突,所以为了避免这个问题,并解决这个问题,我使用了这个jquery函数,它可以工作

         var $j = jQuery.noConflict();
    
    然后使用$j,而不是像这样使用$:

         $j(function() {
    
        $j("#dialog-message").dialog({
            modal: true,
            draggable: false,
            resizable: false,
            position: ['center', 'center'],
            width: 500,
            height: 250,
            dialogClass: 'ui-dialog-osx',
            buttons: {
                "I've read and understand this": function() {
                    $j(this).dialog("close");
                }
            }
        });
    
    });
    

    由于大多数javascript库都使用美元符号$来操作它们的函数,包括不同的javascript,因此为了避免这个问题,并解决这个问题,我使用了这个jquery函数,它可以工作

         var $j = jQuery.noConflict();
    
    然后使用$j,而不是像这样使用$:

         $j(function() {
    
        $j("#dialog-message").dialog({
            modal: true,
            draggable: false,
            resizable: false,
            position: ['center', 'center'],
            width: 500,
            height: 250,
            dialogClass: 'ui-dialog-osx',
            buttons: {
                "I've read and understand this": function() {
                    $j(this).dialog("close");
                }
            }
        });
    
    });
    

    它可以正常工作。

    1)搜索错误消息2)正确加载插件(可能无法加载所述脚本资源;检查网络活动),1)搜索错误消息2)正确加载插件(可能无法加载所述脚本资源;检查网络活动),我试着在网上使用这个脚本,同样的问题是,我在seprate页面中使用了我的代码,它可以工作,但在我的应用程序中使用它时,它就不能工作了。应用程序中使用了哪些其他JS库?如果它是托管的,请共享URL,否则仅凭假设很难进行调查。我试图在网上使用此脚本,同样的问题是,我在seprate页面中使用了我的代码,它可以正常工作,但在我的应用程序中使用它时,它不会正常工作。应用程序中使用了哪些其他JS库?请共享URL,如果它是托管的,否则很难仅根据假设进行调查。