PDA

View Full Version : Error Message: Object doesn't support this property or method



Khamis
12-08-2009, 10:36 PM
Hello all. I'm having an Internet Explorer (both 6 and 7) issue. It's a javascript problem, and as I'm not much of a javascript developer, it's going over my head.

-------------------------------------------------------------------

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">


<title>Madrasatunnur-Media</title>
<style>
.drag {position: relative; cursor: hand}
</style>
<script src="khutba.js"></script>
</head>

<body topmargin="0" leftmargin="0" rightmargin="0" onload="PlayPauseSet()">

<table border="0" cellpadding="0" cellspacing="0" width="530">
<tr>
<td>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>NMadrasatunnur- Media</title>
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="202">
<img border="0" src="images/top_0001.gif" width="202"/></td>
<td width="129" height="72">
<img border="0" src="images/top_02.gif" width="129" height="72"/></td>
<td width="128" height="72">
<img border="0" src="images/top_03%20(2).gif" width="128" height="72"/></td>
<td height="72" width="71">
<img border="0" src="images/top_04%20(2).gif" height="72" width="71"/></td>
</tr>
</table>
</body>

</html>


</td>
</tr>
</table>

<TABLE WIDTH=530 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD WIDTH=21 valign="top" background="images/body_01.gif" >

<TABLE WIDTH=21 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD WIDTH=21 valign="top" background="images/body_01.gif" >
<IMG SRC="images/body_01.gif" ></TD>
</TR>
</TABLE>
</TD>
<TD width=328 valign="middle" align="right" bgcolor="#E4E9F6" >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center"><table border="0" cellpadding="0" cellspacing="0" height="200" width="320">
<tr>
<td>
<p style="margin-top: 0; margin-bottom: 0">
<img alt="" src="images/art.jpg" width="320" height="200"></td>
</tr>

</table>
</td>
</tr>
</table>
</TD>
<TD width=153 bgcolor="#E4E9F6" valign="top" >
<table border="0" cellpadding="0" cellspacing="1">
<tr>
<td width="50" valign="top" align="left">
<p style="margin-left: 2" align="left"><b>
<font color="#032F81" face="Tahoma" size="2">Speaker:</font></b></td>
<td width="82%">
<p style="margin-left: 3; margin-right: 12">
<font face="Verdana" size="2" color="#032F81">Ust. Nassor Bachu</font></td>
</tr>
<tr>
<td width="50" valign="top" align="left">
<p style="margin-left: 2" align="left"><b>
<font color="#032F81" face="Tahoma" size="2">Title:</font></b></td>
<td width="82%">
<p style="margin-left: 3"><font face="Verdana" size="2" color="#032F81">Kisa cha Nabii Ayyub</font></td>
</tr>
<tr>
<td width="50" valign="top" align="left">
<p style="margin-left: 2" align="left"><b><font color="#032F81" face="Tahoma" size="2">Masjid:</font></b>
</td>
<td width="82%">
<p style="margin-left: 3"><font face="Verdana" size="2" color="#032F81">Raha Leo</font></td>
</tr>
<tr>
<td width="50" valign="top" align="left"><p style="margin-left: 2" align="left"><b><font color="#032F81" face="Tahoma" size="2">Date:</font></b></p>
</td>
<td width="82%">
<p style="margin-left: 3; margin-right: 3"><font face="Verdana" size="2" color="#032F81">-</font></td>
</tr>
</table>


<div style="visibility:hidden; position: absolute; top: 140; left: 150; width: 1; height: 1" >
<EMBED SRC="001%20Fatiha%201-7.ra" NAME="javademo" WIDTH="0" HEIGHT="0" CONTROLS="ImageWindow" autoStart="1">
</div>

</TD>
<TD width=10 bgcolor="#E4E9F6" valign="top" >&nbsp;
</TD>
<TD WIDTH=18 valign="top" background="images/body_04.gif" >

<TABLE WIDTH=18 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD WIDTH=18 valign="top" >
<IMG SRC="images/body_04.gif" ></TD>
</TR>
</TABLE>


</TD>
</TR>
</TABLE>
<table border="0" cellpadding="0" cellspacing="0" width="530">
<tr>
<td>

<TABLE WIDTH=530 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD COLSPAN=17>
<IMG SRC="images/Tools_01.gif" ></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/Tools_02.gif" ></TD>
<TD>
<p style="margin-bottom: -5">
<IMG id ="splay" onClick="PlayPauseSet()" SRC="images/Tools_03.gif" border="0" alt="Play" style="cursor:hand">
</p>
</TD>
<TD>
<IMG SRC="images/Tools_04.gif" ></TD>
<TD>
<a href="javascript:void(0)" onClick="StopSet()">
<IMG SRC="images/Tools_05.gif" border="0" alt="Stop"></a></TD>
<TD>
<IMG SRC="images/Tools_06.gif" ></TD>
<TD>
<a href="javascript:void(0)" onClick="RewindButton()">

<IMGSRC="images/Tools_07.gif" border="0"></a></TD>
<TD>
<IMG SRC="images/Tools_08.gif" ></TD>
<TD>
<a href="javascript:void(0)" onClick="FastForwardButton()">
<IMG SRC="images/Tools_09.gif" border="0"></a></TD>
<TD>
<IMG SRC="images/Tools_10.gif" ></TD>
<TD background="images/Tools_10.gif" valign="middle">

<div id="SoundLayer1" style="position:relative; width:205px; height:29px; z-index:1">

<div id="divVideoClockContainer" class="clsVideoClockContainer">
<span style="font-size:10pt; font-family: Verdana; color: #003399; margin-bottom: 0" id="divVideoClock" class="clsVideoClock">00:00:00</span>
<span style="font-size:10pt; font-family: Verdana; color: #003399; margin-bottom: 0" class="clsVideoClock">/</span>
<span style="font-size:10pt; font-family: Verdana; color: #003399; margin-bottom: 0" id="divVideoClockend" class="clsVideoClock">00:00:00</span>
</div>

</div>

</TD>
<TD background="images/Tools_10.gif" valign="middle">

</TD>
<TD>
<IMG SRC="images/Tools_12.gif" ></TD>
<TD>
<IMG id="smute" onClick="muteSet()" SRC="images/Tools_13.gif" border="0" alt="Mute" style="cursor:hand"></TD>
<TD>
<IMG SRC="images/Tools_14.gif" ></TD>
<TD>


<div id="SoundLayer" style="position:relative; width:59px; height:29px; z-index:1">
<p style="margin-bottom: -5">
<IMG SRC="images/Tools_15.gif" >
<div id="innerLyr" style="position: absolute; width: 50px; height: 13px; z-index: 2; left: 0px; top: 8px">
<img id="SoundDrag" src="images/SoundDrag.gif" class="drag" onmousedown="dragLayer()" style="width: 12px; height: 13px; z-index:3; left: 25px; top: 0px" width="12" height="13" alt="Volume">
</div>
</div>

<TD>
<IMG SRC="images/Tools_16.gif" ></TD>
<TD>
<IMG SRC="images/Tools_17.gif" ></TD>
</TR>
<TR>
<TD COLSPAN=17>
<IMG SRC="images/Tools_18.gif" ></TD>
</TR>
<TR>
<TD COLSPAN=17>
<IMG SRC="images/Tools_19.gif" ></TD>
</TR>
</TABLE>
</td>
</tr>
</table>
-----------------------------------------------------------------------

The error I get in IE is this:
Error Message: Object doesn't support this property or method
Khutba.js
Line: 38
Code: 0
char 9

URI: http://madrasatunnur.org/Players/khutba.js

Any suggestions as to a fix would be MOST appreciated!

Thanks

jscheuer1
12-09-2009, 07:25 AM
The line, if that is the correct one is:


if(!document.javademo.DoPlay() && tempPlay==0)

Now, this test assumes that there is a DoPlay method* available to the document.javademo object (an embed tag on the page) and that it will return either a true (or truthy) response or a false (or falsy) one.

However, that error tends to suggest that there is no such method available to that object.

A better test would be to first check if DoPlay even exists for that object. In fact that probably is what was intended there in the first place. If so, that line should look like this:


if(document.javademo.DoPlay && tempPlay==0)

There could also be other problems.



* It has to be a method and not a property because it has the () after it that denotes it is a function (another term for a method).

Khamis
12-09-2009, 11:16 AM
Thanks John for your nice responce.
I have checked it Doplay method does exist, cause when i test through my computer offline, it play and when i upload it doesnt play.

I have changed it code to
if(document.javademo.DoPlay && tempPlay==0
and i gave me another error

The error I get in IE is this:
Error Message: Object doesn't support this property or method
Khutba.js
Line: 49
Code: 0
char 5

Thanks,

jscheuer1
12-09-2009, 01:50 PM
It may work locally in IE 6 or IE 7, but both of those error messages are from IE 8. In IE 6 and 7 you would get this sort of error message:


Line: 50
char 5
Error Message: Object doesn't support this property or method
Code: 0
URL: http://madrasatunnur.org/Players/00.html

See the difference?

There is no DoPlay function in your code. So either it is in another script somewhere, other than Khutba.js and that other script is missing, or more likely it's the RealAudio plug in native DoPlay function. RealAudio is the most likely plug in used to play content with the .ra extension like:


<EMBED SRC="001%20Fatiha%201-7.ra" NAME="javademo" WIDTH="0" HEIGHT="0" CONTROLS="ImageWindow" autoStart="1">

In our new code we now have this function:


function PlayPauseSet() {
if(document.javademo.DoPlay && tempPlay==0) {
tempPlay=1;
document.javademo.DoPlay();
document.getElementById('splay').src='images/Tools_003.gif';
document.getElementById('splay').title="Play Now";
bolIsPlaying = true;
idVideoClockTimer = window.setInterval("intervalCalls()", 200);
}
else
{
tempPlay=0;
document.javademo.DoPause();
document.getElementById('splay').src='images/Tools_03.gif';
document.getElementById('splay').title="Pause Now";
bolIsPlaying = false;

}
}

This is the error line:


document.javademo.DoPause();

If document.javademo supported the DoPlay method, that line would not execute. DoPause is also a native RealAudio method.

So, if the very same browser that is giving you this error works locally, that means that its RealAudio plug in that is required for this only works locally. It's unlikely that this is the case. It most likely means that the RealAudio plug in is missing completely or disabled in that browser.

Khamis
12-09-2009, 09:54 PM
John Thank you.

I give up, i will try to get another script for the player.

once again thanks for ur time.

jscheuer1
12-10-2009, 06:56 AM
It's not the script, though that one doesn't look real well thought out to me, it assumes that the RealAudio plug in is installed and reasonably up to date.

But the actual problem is that the RealAudio plug in is either not installed or not available in that browser for that page.