Connecting Tech Pros Worldwide Help | Site Map

How to Embed HTML in JavaScript

Newbie
 
Join Date: Jan 2008
Posts: 3
#1: Nov 4 '08
I want to embed the following code in javascript function javascript function is written just after the object code, I want to replace the popup window code with this object code while the file name will be received in function parameter.

[HTML]<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0"
ID=Child1 width=820 height=621>
<param name=src value="Child1.dcr">
<param name=swRemote value="swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true' ">
<param name=swStretchStyle value=none>
<PARAM NAME=bgColor VALUE=#DDDDDD>
<embed src="Child1.dcr" bgColor=#DDDDDD width=820 height=621 swRemote="swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true' " swStretchStyle=none
type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/"></embed>
</object>[/HTML]

[HTML]<script type="text/javascript">
function jump(menu){
var vLen = menu.choice.options[menu.choice.selectedIndex].value.length;
var vExt = menu.choice.options[menu.choice.selectedIndex].value.substring(vLen-3,vLen);

if (vExt == 'dxr' || vExt == 'dcr'){
MyWindow3=window.open('images/'+menu.choice.options[menu.choice.selectedIndex].value,'MyWindow3',"height=600,width=800,toobar=0, location=0,directories=0,status=0,menubar=0,scroll bars=1,resizeable=0");
vExt=null;
}
}
</script>[/HTML]
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Nov 4 '08

re: How to Embed HTML in JavaScript


Quote:

Originally Posted by ShahzadMahmood

I want to replace the popup window code with this object code

Do you mean you want to create the object element or do you want to set the value of a param element?
Reply