/    Sign up×
Community /Pin to ProfileBookmark

Modal Window Error

Hi,

I apologize if I’ve put this in the wrong category.

I’m having an IE specific issue and I have no clue how to resolve it.

I am using prototype, scriptaculous, and dialog (an extension written by Jeff Smick at [url]http://snippets.dzone.com/posts/show/3411[/url]). I’m using dialog to create a modal dialog. In Firefox, it works perfectly.

When using IE, I’m getting a “Object doesn’t support this property or method” when implementing the dialog.

The error is being thrown on the line: [B]$(domid).show();[/B]

Here’s my code sample:

[CODE]<script type=”text/javascript”>
function displayAnnouncementDetail(anid,domid)
{
new Dialog.Box(domid);
[B]$(domid).show();[/B]

var opt = {
onSuccess: function(t) {
//evaluate response so that announcementHeader and announcementBody are set
eval(t.responseText);

if(announcementHeader != ” && announcementBody != ”)
{
document.getElementById(‘announcementHeader’).innerHTML = announcementHeader;
document.getElementById(‘announcementBody’).innerHTML = announcementBody;
}
else
{
$(domid).hide();
}
},
on404: function(t) {
alert(‘Error 404: location “‘ + t.statusText + ‘” was not found.’);
},
onFailure: function(t) {
alert(‘Error ‘ + t.status + ‘ — ‘ + t.statusText);
}
}

new Ajax.Request(‘/index.php/myhome/getAnnouncement/’ + anid, opt);
}
</script>
[/CODE]

[b]anid[/b] is just a unique id that gets passed with the ajax call.
[b]domid[/b] is the container id that is used for the modal dialog. For example, I have:

[CODE]
<div id=”announcementContainer” style=”display:none;”>
<div id=”announcementHeader”>Announcement</div>
<div id=”announcementBody”>Loading…</div>
<div id=”announcementFooter”><a href=”javascript:void(0);” onClick=”$(‘announcementContainer’).hide();”>Close Announcement</a></div>
</div>
[/CODE]

So, when I call my function, I use something like:

[CODE]<a href=”javascript:void(0);” onClick=”displayAnnouncementDetail(‘6′,’announcementContainer’);”>site admin announcement</a>[/CODE]

Like I stated above, in Firefox it works perfect. In IE, I get the error.

I have attached the dialog.js extension that I’m using.

Thanks!

[upl-file uuid=859b1959-bfad-42cc-b3cf-9021807264f6 size=2kB]dialog.txt[/upl-file]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@PhxVyperauthorFeb 06.2008 — bump.

Help? Nobody has any clue why this error occurs in IE?
×

Success!

Help @PhxVyper spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...