/    Sign up×
Community /Pin to ProfileBookmark

Basic Problem in Firefox

Hi all, this is my first post. ?

First of all, excuse me for my english… I’m italian ?

My problem is about this simple code:

[CODE]
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script type=”text/javascript”>
<!–
function showVideo(){
document.write(“<object id=”video” width=”320″ height=”240″ classid=”clsid:6bf52a52-394a-11d3-b153-00c04f79faa6″ type=”application/x-oleobject”> <param name=”url” value=”http://www.rainews24.it/ran24/speciali/guerra_petrolio/video/petrolio_1.wmv”> <param name=”sendplaystatechangeevents” value=”true”> <param name=”autostart” value=”true”> <param name=”uimode” value=”none”> <param name=”playcount” value=”9999″></object>”);
}
//–>
</script>
</HEAD>

<BODY>
<TABLE>
<TR>
<TD><script>showVideo();</script></TD>
<TD><script>showVideo();</script></TD>
</TR>
</TABLE>
</BODY>
</HTML>
[/CODE]

It works perfectly in Internet Explorer, but in Firefox the videos are not shown.

Why??? ? ? ? ?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliJul 10.2005 — u need to understand first where and when document.write () should be used.

[b]document.write ()[/b] can be used when a document is not created as yet. which means you should place the show video code in the head and do not call it in the body.

Second there are other ways(in my opinin better) to get such work done. Which is istead of document.write(), you can use element.innerHTML or add a new element (object) and then set all of its parameter.
Copy linkTweet thisAlerts:
@EpperauthorJul 10.2005 — Thankyou Very Much!!!!

I thought it was like PHP ? ? ?

(There is another problem in my code: Firefox doesn't like <object> so I've to user <embed>.)

Thankyou Again ?
Copy linkTweet thisAlerts:
@ExuroJul 10.2005 — (There is another problem in my code: Firefox doesn't like <object> so I've to user <embed>.)[/QUOTE]
Actually, Firefox has better support for the [FONT=Courier New]<object>[/FONT] tag than Internet Explorer, you're just not implementing it correctly:
&lt;object width="320" height="240" type="video/x-ms-wmv"
data="http://www.rainews24.it/ran24/speciali/guerra_petrolio/video/petrolio_1.wmv"&gt;
Please download the latest version of Windows Media Player&lt;/object&gt;


You'll probably need to add the [FONT=Courier New]clssid[/FONT] and [FONT=Courier New]<param>[/FONT] back in again for it to work in Internet Explorer again, but [i]that[/i] is how the [FONT=Courier New]<object>[/FONT] tag is [i]supposed[/i] to work.
Copy linkTweet thisAlerts:
@EpperauthorJul 10.2005 — Actually, Firefox has better support for the [FONT=Courier New]<object>[/FONT] tag than Internet Explorer, you're just not implementing it correctly:
&lt;object width="320" height="240" type="video/x-ms-wmv"
data="http://www.rainews24.it/ran24/speciali/guerra_petrolio/video/petrolio_1.wmv"&gt;
Please download the latest version of Windows Media Player&lt;/object&gt;


You'll probably need to add the [FONT=Courier New]clssid[/FONT] and [FONT=Courier New]<param>[/FONT] back in again for it to work in Internet Explorer again, but [i]that[/i] is how the [FONT=Courier New]<object>[/FONT] tag is [i]supposed[/i] to work.[/QUOTE]

Thankyou very Much... I didn't know this... ?
Copy linkTweet thisAlerts:
@ExuroJul 10.2005 — No problem! That's what the forum's for after all! :p
×

Success!

Help @Epper 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...