[thelist] Adding embed using dom fails on IE
Chris Price
chris.price at choctaw.co.uk
Wed Aug 22 05:44:42 CDT 2007
My task has been to display an image on the page which, when clicked,
loads a streaming video using object and embed.
Using createElement and appendChild I have successfully applied the
solution in FF but in IE I get an 'invalid argument' error.
I can append the param elements but IE rejects the embed element.
Having scoured the web I am coming to the conclusion that I am on a
hiding to nothing.
The code looks like this:
<snip>
function showVid(placeHolder,clip) {
var new_node
placeHolder.style.border = '2px solid #e2e2ce'
existing_node = placeHolder.getElementsByTagName('img')[0]
param_a_value = 'http://.../SWplayer.swf'
param_a = document.createElement('param')
param_a.setAttribute('value',param_a_value)
param_a.setAttribute('name','movie')
param_b_value = 'clip=choctaw_fl/' + clip + '&wskin=none'
param_b = document.createElement('param')
param_b.setAttribute('value',param_b_value)
param_b.setAttribute('name','FlashVars')
param_c_value = 'high'
param_c = document.createElement('param')
param_c.setAttribute('value',param_c_value)
param_c.setAttribute('name','quality')
param_d_value = 'clip=choctaw_fl/' + clip + '&wskin=none'
param_d = document.createElement('embed')
param_d.setAttribute('height','250')
param_d.setAttribute('width','400')
param_d.setAttribute('quality','high')
param_d.setAttribute('FlashVars',param_d_value)
param_d.setAttribute('src','http://.../SWplayer.swf')
new_node = document.createElement('object')
new_node.setAttribute('width','400')
new_node.setAttribute('height','250')
new_node.appendChild(param_a)
new_node.appendChild(param_b)
new_node.appendChild(param_c)
new_node.appendChild(param_d) // FAILS HERE
placeHolder.replaceChild(new_node,existing_node)
}
</snip>
Is there any hope?
Kind Regards
--
Chris Price
Choctaw
chris.price at choctaw.co.uk
http://www.choctaw.co.uk
Tel. 01524 825 245
Mob. 0777 451 4488
Beauty is in the Eye of the Beholder
while Excellence is in the Hand of the Professional
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-+- Sent on behalf of Choctaw Media Ltd -+-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Choctaw Media Limited is a company
registered in England and Wales
with company number 04627649
Registered Office:
Lonsdale Partners,
Priory Close,
St Mary's Gate,
Lancaster LA1 1XB
United Kingdom
More information about the thelist
mailing list