Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
Leandro_Brazil #1
find a object in a page and replace it
Hi,
I?m created an extension to modify the DTD in a page. But I?m having some
dificultes.
I?m get it, using this code:
var DOM = dw.getDocumentDOM();
var Document = DOM.documentElement.outerHTML;
var insert = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
DOM.source.replaceRange(0, Document..indexOf('<html>'), insert);
of course, that is a piece of my code.
The code above function perfect. But only when a page doesn?t have a DTD in it.
With the page contain the DTD the code above, don?t function.
To change the DTD in a page I need to have something like it:
DOM.source.replaceRange(0, Document..indexOf('<html
xmlns="http://www.w3.org/1999/xhtml">'), insert);
Exist some comand to DW identify if this attribute
(xmlns="http://www.w3.org/1999/xhtml") exist or somethink like it?
I could place a checkbox to user check, with the page has or not a DTD, but it
dont will be good for the user.
Some idea?
Leandro_Brazil Guest
-
Advanced Find & Replace
A client has changed their format for displaying phone numbers. Currently there are hundreds of listings in (XXX) XXX-XXXX format and they all need... -
Need help with Find & Replace
Hiya. I've tried everything I know to find and replace text in 400+ documents and now need some help with it. This is the existing source code: ... -
Find and Replace Howto
Hi, I am newbie to Perl and would like to know if this possible doing in Perl. I have huge number of .4gl files. I need to find and replace... -
find/replace
when a user searched for a value with find/replace from a form he got the message the value could not be found but when I looked for it in the... -
find and replace everything between 2 tags
Hello aronk, Backup the files first. Then set up Find and Replace to Find (there shouldn't be any line breaks): (<!DOCTYPE HTML PUBLIC...



Reply With Quote

