3

My this code was working fine until I upgraded to Jquery newer version. Now I get above error.

 <link rel="stylesheet" type="text/css" href="site.css" />
    <link type="text/css" href="css/smoothness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />   
     <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>    
    <script type="text/javascript" src="js/ddsmoothmenu.js"></script>

    <script type="text/javascript">    
         $(document).ready(function(){     
                $('#dialog').dialog({
                    modal: true,
                    autoOpen: false,
                    width: 760,
                    height: 'auto',             
                    close: function(event, data) {
                        $('#mainFrame')[0].src = "LoadingPage.aspx";
                    }
                });
                $('a[name="dia"]').click(function(){
                    $('#mainFrame')[0].src = this.file;
                    $('#dialog').data('title.dialog', this.innerText); 
//                    $('#dialog').data('width.dialog', this.diaWidth); 
//                    $('#dialog').data('height.dialog', this.diaHeight); 
                    $('#dialog').dialog('open');
                    return false;
                });             

                if (document.getElementById('hidIsAdmin').value == "1"){
                    document.getElementById('liAdmin').style.display = 'block';
                    document.getElementById('liReports').style.display = 'block';
                }else {
                    $('#liAdmin').remove();
                    $('#liReports').remove();

                }
                if (document.getElementById('hidCreate').value == "1"){
                    document.getElementById('liCreate').style.display = 'block';
                }else {
                    $('#liCreate').remove();
                    $('.edit_icon_link').hide(0);                   
                }
            });
            function hideEditIcon(){
                $('.edit_icon_link').hide(0);                   
            }            
    </script>
6
  • Is the jQuery UI version you're using compatible with the jQuery version? You might need to download a newer version. Commented Mar 3, 2011 at 13:43
  • What exactly did you upgrade? What file? Commented Mar 3, 2011 at 13:44
  • I changed jquery-1.3.2.min.js to jquery-1.4.4.min.js And jquery-ui-1.7.1.custom.min.js to jquery-ui-1.8.10.custom.min.js and Css jquery-ui-1.7.1.custom.css to jquery-ui-1.8.10.custom.css. That's all. It worked fine with previous version. Commented Mar 3, 2011 at 13:53
  • Make sure the files are really loaded using HttpWatch for example. Commented Mar 3, 2011 at 14:03
  • This is how it was before with old file names and now with new file names. <link type="text/css" href="css/smoothness/jquery-ui-1.8.10.custom.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" /> <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script> <script type="text/javascript" src="js/ddsmoothmenu.js"></script> Commented Mar 3, 2011 at 14:08

5 Answers 5

3

I had something similar happen (converting MVC3 ASP to Razor), and in my case, moving my jquery-1.4.4.min.js reference to my master page helped.

I say "helped" because now the open works, but the $(this).dialog("close"); doesn't.

function ShowPopUp(strDivName)
{
    $("div[id$='" + strDivName + "']").dialog(
        {
            title: "blah blah blah",
            width: 600,
            modal: true,
            resizable: true,
            closeOnEscape: false,
            buttons:
            {
                "Save": function () { SaveThis(); $(this).dialog("close"); },
                "Cancel": function () { $(this).dialog("close"); }
            }
        }
    );
    $("div[id$='" + strDivName + "']").dialog("open");
}
Sign up to request clarification or add additional context in comments.

Comments

0

Check the options available for dialog, I think autoResize has been renamed to resizable.

2 Comments

But it won't generate "object doesn't support.." error.. or can it? :/
{ resizable : true } allows users to drag the edges of the dialog to resize it. AutoResize appears to be something else, although I don't see it in the documentation.
0

Is it possible that you are not closing your $(document).ready(function(){ ?

The }); you are showing above closes the $('#dialog').dialog({ but I don't see a close of the $(document).ready(function(){ .

6 Comments

$(document).ready(function(){ $('#dialog').dialog({ modal: true, autoOpen: false, width: 760, height: 'auto', close: function(event, data) { $('#mainFrame')[0].src = "LoadingPage.aspx"; } });$('a[name="dia"]').click(function(){ $('#mainFrame')[0].src = this.file; $('#dialog').data('title.dialog', this.innerText); $('#dialog').dialog('open'); return false; });
if (document.getElementById('hidIsAdmin').value == "1"){ document.getElementById('liAdmin').style.display = 'block'; document.getElementById('liReports').style.display = 'block'; }else { $('#liAdmin').remove(); $('#liReports').remove(); } if (document.getElementById('hidCreate').value == "1"){ document.getElementById('liCreate').style.display = 'block'; }else { $('#liCreate').remove(); $('.edit_icon_link').hide(0); }
}); function hideEditIcon(){ $('.edit_icon_link').hide(0); }
@user643062 please edit your question and add the code there, putting whole code in comments is not really readable.
Shadow Wizard - done, please let me know if you need any other info. Everything was working fine and still the same code works fine if just replace following 3 lines with old versions. <link type="text/css" href="css/smoothness/jquery-ui-1.8.10.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>
|
0

I ran into this problem with IE8 because I was on a HTTPS page but loading jquery-ui package from a HTTP CDN. As soon as I changed the url from

http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js

to

https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js

it started working.

Comments

0

I'm now using MVC4. So I had to add jquery-ui-1.8.20.js to the BundleConfig.RegisterBundles() under App_Start to get it to work:

bundles.Add( new ScriptBundle( "~/bundles/jquery" ).Include(
  "~/Scripts/jquery-{version}.js",
  "~/Scripts/jquery-ui-1.8.20.js" ) );

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.