Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
Leandro_Brazil #1
dom.source.insert And dom.insertHTML
Hi,
I?m needing to insert two code in page with a extension tha I?m creating. The
first code stay inside the <head> tag, so I?m using that:
dom.source.insert(doc.indexOf('</head>'), insertCodeScript);
And the other code, will be insert in the position of the user page. So I?m
using that:
dom.insertHTML(insertCode);
So, the Dreamweaver doens?t run the two code, when him (dw) insert the first
(dom.source.insert....) it?s stop. I need to run the two code.
How to do the Dreamweaver run the two code?
Leandro_Brazil Guest
-
insertHTML won't work with XML files
I am trying to create a command that writes text to an open XML file. The command I've created works fine under some circumstances but not others. ... -
insertHTML
I'm trying to use the dom.insertHTML tag to insert a piece of code that contains an id attribute with the id specified. When I do this the id gets... -
INSERT statement contains fewer items than the insert list
The block of code below shows how I am inserting field values into my dbase table: strSQLStatement = "INSERT INTO tblArticles... -
SCO, Open Source and the Un*x source code
On Sat, Jul 19, 2003 at 04:51:08PM +0000, tony@aplawrence.com wrote: .... Isn't SCO claiming that they own all the Unix IP in the world :-). ... -
Insert PDF movie links from TeX source file?
I prepare documents using TeX (Plain, not LaTeX), distill to PDF, then insert movie links (links to .mov files) by hand using Acrobat. If I know... -
Leandro_Brazil #2
Re: dom.source.insert And dom.insertHTML
More details about the error specified above.
In some tests, I did here, I could understand that:
The extension is function perfect in the Code View only. But I?m using this
code:
function isDOMRequired() {
// Return false, indicating that this object is available in code view.
return false;
}
With I pretend that the extension, function in the Code View too, but the
extension is function perfect only in this mode.
Some idea?
Leandro_Brazil Guest
-
Leandro_Brazil #3
Re: dom.source.insert And dom.insertHTML
Other strange thing:
If I use the extension in the Design View, only the code inserted with this
code:
dom.source.insert(doc.indexOf('</head>'), insertCodeHead);
appear in the HTML code. So if I execute Ctrl + Z the code inserted disappear
(obviuos). So I change to the Design View, and the surprise: the code that must
be inserted with this code:
dom.insertHTML(insertCode);
appear mysteriously.
Hot to solve it?
Leandro_Brazil Guest
-
Leandro_Brazil #4
Re: dom.source.insert And dom.insertHTML
beyond this code:
dom.source.insert(doc.indexOf('</head>'), insertCodeHead);
What the other i can insert a code inside the <head> tag?
Leandro_Brazil Guest
-
T.Pastrana - 4Level #5
Re: dom.source.insert And dom.insertHTML
Leanardo,
You could also try this...
var dom = dw.getActiveWindow();
var dwHead = dom.getElementsByTagName('head');
dwHead[0].innerHTML += 'Your Code to Insert';
For the body it would be like this....
var dom = dw.getActiveWindow();
var dwBody = dom.getElementsByTagName('body');
dwBody[0].innerHTML += 'Your Code to Insert';
Note: This will add code to the body but will not place it at the cursor
position.
--
Regards,
...Trent Pastrana
[url]www.fourlevel.com[/url]
"Leandro_Brazil" <webforumsuser@macromedia.com> wrote in message
news:dkg71t$pec$1@forums.macromedia.com...> beyond this code:
> dom.source.insert(doc.indexOf('</head>'), insertCodeHead);
>
> What the other i can insert a code inside the <head> tag?
T.Pastrana - 4Level Guest
-
Leandro_Brazil #6
Re: dom.source.insert And dom.insertHTML
Pretty good. It solve my problem.
I used that:
var dom = dw.getActiveWindow();
var dwHead = dom.getElementsByTagName('head');
dwHead[0].innerHTML += 'Your Code to Insert';
to insert the code inside the <head> tag. And the objecTag to insert the other
code, in the cursor position :D.
Now, only I question. What the diference between: var dom =
dw.getActiveWindow(); and var dom = dw.getDocumentDOM();?
Thanks.
Leandro_Brazil Guest
-
T.Pastrana - 4Level #7
Re: dom.source.insert And dom.insertHTML
Actually you should probably use dw.getDocumentDOM() as this will insert the
code in the document where the cursor is whether your using a Frameset or
not. Using dw.getActiveWindow() will place the code in the Frameset instead
of the frame with the cursor inside of it.
--
Regards,
...Trent Pastrana
[url]www.fourlevel.com[/url]
"Leandro_Brazil" <webforumsuser@macromedia.com> wrote in message
news:dkh0s7$1la$1@forums.macromedia.com...> Pretty good. It solve my problem.
>
> I used that:
>
> var dom = dw.getActiveWindow();
> var dwHead = dom.getElementsByTagName('head');
> dwHead[0].innerHTML += 'Your Code to Insert';
>
> to insert the code inside the <head> tag. And the objecTag to insert the
> other
> code, in the cursor position :D.
>
> Now, only I question. What the diference between: var dom =
> dw.getActiveWindow(); and var dom = dw.getDocumentDOM();?
>
> Thanks.
>
T.Pastrana - 4Level Guest
-
T.Pastrana - 4Level #8
Re: dom.source.insert And dom.insertHTML
Let me explain it a bit better.
If your open document is not a Frameset there is no difference between
dw.getDocumentDOM() and dw.getActiveWindow(). The results will be the same.
If you are using a Frameset, dw.getActiveWindow() will insert the code
inside of the Frameset, not any of the frames and dw.getDocumentDOM() will
place the code in the frame which has focus, or the one where the cursor was
when the extension was launched.
--
Regards,
...Trent Pastrana
[url]www.fourlevel.com[/url]
"T.Pastrana - 4Level" <aaaa@aaaa.com> wrote in message
news:dkh1ao$28f$1@forums.macromedia.com...> Actually you should probably use dw.getDocumentDOM() as this will insert
> the code in the document where the cursor is whether your using a Frameset
> or not. Using dw.getActiveWindow() will place the code in the Frameset
> instead of the frame with the cursor inside of it.
>
>
> --
> Regards,
> ..Trent Pastrana
> [url]www.fourlevel.com[/url]
>
>
>
>
>
>
> "Leandro_Brazil" <webforumsuser@macromedia.com> wrote in message
> news:dkh0s7$1la$1@forums.macromedia.com...>>> Pretty good. It solve my problem.
>>
>> I used that:
>>
>> var dom = dw.getActiveWindow();
>> var dwHead = dom.getElementsByTagName('head');
>> dwHead[0].innerHTML += 'Your Code to Insert';
>>
>> to insert the code inside the <head> tag. And the objecTag to insert the
>> other
>> code, in the cursor position :D.
>>
>> Now, only I question. What the diference between: var dom =
>> dw.getActiveWindow(); and var dom = dw.getDocumentDOM();?
>>
>> Thanks.
>>
>
T.Pastrana - 4Level Guest
-
Leandro_Brazil #9
Re: dom.source.insert And dom.insertHTML
Excellent explication.
Now I understand the diference.
Thanks.
Leandro_Brazil Guest



Reply With Quote

