Solved

Using untranslated source code.

Posted on 2002-06-26
5
138 Views
Last Modified: 2010-04-25
I want to use the DOM to manipulate the untranslated source code seen in the code view.  However, dw.getDocumentDOM('document') returns the DOM for the translated code.  How do I get around this?
    Thanks,

      -Josh Brown
0
Comment
Question by:ElPoojmar
5 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 7115320
isn't that the point of using the getDocumentDOM..
to return the tree of objects..which you then edit?

also this NOTE from DW help..

If the argument is "document", the caller must be applyBehavior(), deleteBehavior(), objectTag(), or any function in a command or Property Inspector file in order to perform edits to the document.

(and an example)..

The following code snippet uses dreamweaver.getDocumentDOM() to access the background color of the current document:

var theDOM = dreamweaver.getDocumentDOM("document");
theDOM.body.bgcolor = "#000000";

hope this helps

Z

0
 

Author Comment

by:ElPoojmar
ID: 7116716
There are things in dreamweaver called translators, which
translate the code seen in the code view to something else (such as an image tag) before it is displayed in the design view.  So you can tell dreamweaver to translate

<made_up_tag>

to

<img src="made_up_tag.gif">

So that there is some visible representation of the new tag in design view, while the code view still contains only the original tag.  However, the object theDOM = dreamweaver.getDocumentDOM('document') is the DOM for the TRANSLATED code, so if I place my cursor on the tag "<made_up_tag>" in the code view, theDOM.getSelectedNode().tagName is "IMG" not "MADE_UP_TAG".

I want to know how to get the DOM for the untranslated code (ie the code you see in the code view).
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 7117357
Beautifully explained.
It would seem that translating capabilities are called
with the DOM and need to be separated from it.
I  don't know how you would do this..but search at..
http://www.oreillynet.com/
there might be a solution there..good luck

Z
0
 
LVL 5

Expert Comment

by:zenlion420
ID: 9834705
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

zenlion420
EE Page Editor
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9879865
This question is PAQed and  200 points refunded.

YensidMod
Community Support Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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