Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 06-21-2009, 12:01 PM   #1 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 106
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
Thumbs down Addng a param to an <object>

I'm trying to modify an <object> element dynamically, to add
<param name="wmode" value="transparent">

i'm working with the standard youtube embed:
Code:
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/adsasdrwr=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/adsasdrwr&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>
i've confirmed (with a dom inspector) that the code below adds the param, but apparently you need to remove and then re-create the Object, in order for it to take effect?
Code:
var objParam = document.createElement("param"); objParam.setAttribute('wmode', 'transparent'); objObject.insertBefore(objParam, objObject.firstChild);
(i know <object> is only used in IE, but i used FF's dom inspector.)

to keep this short, removing and then recreating the <object> tag doesn't work in IE. in fact, simply trying to remove the object hs no effect. but it works in FF -- removing the <object> gets rid of the embedded youtube video (the <embed> tag is a child of the <object> tag).
Code:
var objectz = document.getElementsByTagName('object'); for (n = 0; n < objectz.length; n++){ var obj = objectz[n]; var pn = obj.parentNode; pn.removeChild(obj); }
this has no effect in IE, and no error is thrown...

any help is much appreciated.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-22-2009, 10:10 AM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,504
iTrader: 0 / 0%
kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
You could dynamically create using javascript the entire <object ..../> string, then document.write(yourVariable) possibly
__________________
http://www.kylevarga.com - My blog.
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-22-2009, 01:25 PM   #3 (permalink)
Meeow!
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 3,235
iTrader: 0 / 0%
Latest Blog:
None

Costin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest orderCostin Trifan is a web professional of the highest order
That's the best way to go if you want to customize the object. I tried to add a param after the object is created but I couldn't do it in IE. Always thrown an error on that line (where I append the created param node to parent.)
__________________
...to be continued
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dreamweaver "Param" change not taking affect mr_zedd Coding Forum 0 03-21-2009 05:33 PM
What is a Flash Object? 2939195631902 Web Design Lobby 2 01-07-2009 03:19 AM
PHP Object Sketch Coding Forum 1 10-29-2007 09:28 AM
<object> </object> area clickable softstor Coding Forum 3 06-14-2004 12:35 PM
Warning: main(param.inc): failed to open stream Pimpen 2010 Coding Forum 4 10-14-2003 02:39 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 04:37 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.