[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

dynamic <object> tag

Posted on 2006-04-19
2
Medium Priority
?
480 Views
Last Modified: 2008-03-17
Microsoft recently released a "fix" that, when installed from windows update, causes ActiveX controls in IE to not be activated by default. There is a script workaround, but it doesn't seem to work for me. I'm doing this in my html page:

<body>
<SCRIPT LANGUAGE="JavaScript" SRC="ActiveXLoader.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
      loadHelp()
</SCRIPT>
<DIV ID="helpLauncherDIV"></DIV>
</body>

[ActiveXLoader.js:]

function loadHelp(){
      str = ""
      str += '<OBJECT ID="helpLauncher" CLASSID="CLSID:20DABCB5-AB70-4E2B-BCA9-17155D5CF583"\n'
      str += 'CODEBASE="Resources/helpLauncher.cab#version=1,0,0,1"\n'
      str += 'WIDTH="1" HEIGHT="1">\n'
      str += '</OBJECT>\n'
 
    alert(str)
    alert(document.getElementById("helpLauncherDIV").innerHTML)
      //document.getElementById("helpLauncherDIV").innerHTML = str
}

...the alert fires and shows the dynamic string. but the call to document.getElementById("helpLauncherDIV").innerHTML fails with "object required". Why isn't it finding my DIV? What else can I try? My div is not inside a <FORM>
0
Comment
Question by:SweatCoder
2 Comments
 
LVL 9

Accepted Solution

by:
smaccari earned 2000 total points
ID: 16505662
You have to call your JS function AFTER the div tag:

<DIV ID="helpLauncherDIV"></DIV>
<SCRIPT LANGUAGE="JavaScript">
     loadHelp()
</SCRIPT>

0
 
LVL 11

Author Comment

by:SweatCoder
ID: 16508504
well....duh! my bad.  :-/
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question