PhxVyper
02-06-2008, 09:48 PM
Hi,
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 http://snippets.dzone.com/posts/show/3411). 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: $(domid).show();
Here's my code sample:
<script type="text/javascript">
function displayAnnouncementDetail(anid,domid)
{
new Dialog.Box(domid);
$(domid).show();
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>
anid is just a unique id that gets passed with the ajax call.
domid is the container id that is used for the modal dialog. For example, I have:
<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>
So, when I call my function, I use something like:
<a href="javascript:void(0);" onClick="displayAnnouncementDetail('6','announcementContainer');">site admin announcement</a>
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.
Here is how I'm including prototype and dialog:
<script type="text/javascript" src="/script/prototype.js"></script>
<script type="text/javascript" src="/script/dialog.js"></script>
Any help is appreciated.
Chad
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 http://snippets.dzone.com/posts/show/3411). 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: $(domid).show();
Here's my code sample:
<script type="text/javascript">
function displayAnnouncementDetail(anid,domid)
{
new Dialog.Box(domid);
$(domid).show();
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>
anid is just a unique id that gets passed with the ajax call.
domid is the container id that is used for the modal dialog. For example, I have:
<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>
So, when I call my function, I use something like:
<a href="javascript:void(0);" onClick="displayAnnouncementDetail('6','announcementContainer');">site admin announcement</a>
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.
Here is how I'm including prototype and dialog:
<script type="text/javascript" src="/script/prototype.js"></script>
<script type="text/javascript" src="/script/dialog.js"></script>
Any help is appreciated.
Chad