By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 1,973 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

How to Embed HTML in JavaScript

P: 3
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]
Nov 4 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
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?
Nov 4 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.