sinini
sinini

Reputation: 1433

jquery dialog IE-Error: Object doesn't support this property or method dialog

On Buttonklick, i'm trying to open a dialog and inside the dialog, there is an iframe. The url of the iframe comes from the a-tag. my clickevent is inside $(document).ready(function() { and looks like this:

    $('a.recommend').live('click', function(e) {
    e.preventDefault();                             
    var url = $(this).attr("href");
    var $dialog = $('<div></div>').html('<iframe style="border: 0px; " src="' + url + '" width="450px" height="300px"></iframe>').dialog({
                autoOpen: false,
                modal: true,
                height: 360,
                width: 500
            });
    $dialog.dialog('open');
        });

everythings works fine except in Internet Explorer, following Error show up and nothing happens: Object doesn't support this property or method dialog...

somebody might has an idea?

Upvotes: 1

Views: 5015

Answers (2)

Nicolas Straub
Nicolas Straub

Reputation: 3411

what version of ie are you using? it works fine on ie9 at least (using the latest jquery and jqueryui).

on another note, why are you using iframes? (just curious, I didn't think they were used anymore)

Regards!

Upvotes: 0

Deckard
Deckard

Reputation: 2450

The problem is the

$('<div></div>')

selector because it is in general not a proper selector. Firefox and other browser often are more lenient regarding selector sepcifications while IE is very specific and wants it by the book.

Rather assign an ID or class to the div and then select that class. To select

<div class='mine'></div>

use

 $('.mine')

For

<div id='mine'></div>

use

$('#mine')

Good luck!

Upvotes: 1

Related Questions