Error: TypeError: $(…).dialog is not a function

后端 未结 7 1596
半阙折子戏
半阙折子戏 2020-11-27 06:29

I am having an issue getting a dialog to work as basic functionality. Here is my jQuery source imports:



        
相关标签:
7条回答
  • 2020-11-27 07:13

    if some reason two versions of jQuery are loaded (which is not recommended), calling $.noConflict(true) from the second version will return the globally scoped jQuery variables to those of the first version.

    Some times it could be issue with older version (or not stable version) of JQuery files

    Solution use $.noConflict();

    <script src="other_lib.js"></script>
    <script src="jquery.js"></script>
    <script>
    $.noConflict();
    jQuery( document ).ready(function( $ ) {
       $("#opener").click(function() {
                $("#dialog1").dialog('open');
        });
    });
    // Code that uses other library's $ can follow here.
    </script>
    
    0 讨论(0)
提交回复
热议问题