3 Posts
0 Kudos
Registered: ‎11-05-2011
Post 1 of 2

Can not access ADViewer object in JavaScript

253 Views, 1 Replies
11-17-2011 01:00 AM
Hi All,

I am try use your below code in JavaScript but it does't work.

I am refer Autodesk Design Review 2012 API Reference
I am try to Execute code in "Embedding a DWF File in a Web Page" this topic.
but not able to
execute, some thing is missing and i am not able to find what is missing or
what is wrong. Help

Please try to execute my Code.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
<html xmlns="http://www.w3.org/1999/xhtml" >
<script language="javascript" type="text/javascript">
function getElements()
          var ADViewer = document.getElementById("ADViewer"); // 2nd Way
        var ECompViewer = ADViewer.ECompositeViewer;     // 1st Way
        var Sections = ECompViewer.Sections;
        var secList = document.getElementById("SectionList");
        for (iSection = 1;(iSection <= Sections.Count); iSection++)
                var Section = Sections(iSection); //Set the section to a
separate object
                secList.innerHTML += Section.Title + "<BR>";

<input type="text" size="20" /><br />
<input type="text" size="20" /><br /><br />
<input id="abc" type="button" onClick="getElements()" value="How many input
elements?" />
        <object id="ADViewer" type="application/x-Autodesk-DWF" width="400"

                <param name="Src"
" />



In my PC this code execute in Google Crome but below issue.
Please try this code to execute.
In my Code there are 3 alert boxes.
  In 1 alert box shows [object HTMLObjectElement]
  In 2 alert box shows undefined
  3 rd alert box not executed.

Another thing is that this JavaScript code only run in Google Crome. not in
IE 8.0 or FireFox  3.6.12

When i am using [ classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" ]
this code it will not
execute in Google Crome not IE 8.0 not in FireFox 3.6.12 also not loaded DWF
Viewer in browser.

My PC Configuration is :
      Windows 7 Ultimate
      1 GB RAM
      64-bit OS
      Autodesk Design Review Browser Add-on for NPAPI browser v 1.2
      Autodesk Design Review 2012 Software v installed in PC.

Reply as early as possible.
Thank you.
338 Posts
2 Kudos
Registered: ‎03-05-2008
Post 2 of 2

Re: Can not access ADViewer object in JavaScript

11-17-2011 06:17 PM in reply to: kkcnkc

Thank you for your question.


To insure your script works in both IE and Chrome/Firefox, please refer to this port for solution.



Please let me know if I can be of any further assistance.

Herbert He
SW Engineer
Autodesk, Inc.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!