views:

80

answers:

1

I have a button, that when clicked is supposed to open a jQuery UI Dialog. It works in FF3, FF4, Chrome, and IE8 with ChromeFrame. It does not work in normal IE8. I get an error that simply says "Object required". Below is the function the click calls.

function punchNonProd()
{
    var HTML = "";
    HTML += "<tr id='burdenLine'><td><strong>Description</strong></td><td><input class='ui-corner-all' type='text' id='diaNP' size='12'></td></tr>";
    HTML += "<tr><td>&nbsp;</td><td><span class='button' onClick='sendPunch(\"NONPROD\", $(\"#diaNP\").val(), $(\"#loadedMech\").val());'>Use Description</span></td></tr>";
    HTML += "</table>";

    $("#dialogSmall").dialog("option", "title", 'Non-Billable Punch')
                     .html(HTML)
                     .dialog("option", "width", 800)
                     .dialog("open")
                     .dialog("option", "position", "center")
                     .dialog( "option", "buttons", { "Kochtinuous": function() { punchKochImpr(); },
                                                     "Break": function() { sendPunch("NONPROD", "BREAK", $("#loadedMech").val(), isLeader); },
                                                     "Clean Up": function() { sendPunch("NONPROD", "CLEAN_UP", $("#loadedMech").val(), isLeader); },
                                                     "Huddle": function() { sendPunch("NONPROD", "HUDDLE", $("#loadedMech").val(), isLeader); },
                                                     "Meeting": function() { sendPunch("NONPROD", "MEETING", $("#loadedMech").val(), isLeader);} } );
    loadDefaults();
}

I am using jQuery UI 1.8.4, and jQuery 1.4.2

The error occurs on line 4481 of the uncompressed jQuery file.

UPDATE

I was able to figure out that the problem comes from the command $("#dialogSmall").html(HTML);. I am still trying to figure out why this happens.

+3  A: 

The HTML variable does not contain valid HTML. It may help if you add the missing tags.

Álvaro G. Vicario
I think you're right. He's probably loaded the HTML variable in like it's global or something then lost it's scope... But I don't see how that will result in an error of the jQuery Library, it should just render a sloppy DOM.
This was it. The missing `<table>` was the entire problem. I did a bit more looking at the jQuery that was throwing errors and now I can say with certainty that it was occurring when converting the string into DOM objects. Thank you very much Álvaro G. Vicario
Badger