Skip to main content
Participant
Feb 21, 2008 4:18 AM UTC
Question

Add JavaScript Code to head

We use a customized button for submitting forms or links at work. The code combines DHTML elements for the look and functionality of the button. I've created an extension, and it adds the HTML and CSS code, but when I try to add the JavaScript, I get an error because DreamWeaver tries to parse the JavaScript as a part of the extension.

I can't figure out how to get the JavaScript into the <head> of the document like the CSS. I've looked at numerous functions and I just can't find enough documentation to get a full understanding. Any help is greatly appreciated.
This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Inspiring
Feb 21, 2008 4:28 AM UTC
figmentthinking wrote:
> We use a customized button for submitting forms or links at work. The code
> combines DHTML elements for the look and functionality of the button. I've
> created an extension, and it adds the HTML and CSS code, but when I try to add
> the JavaScript, I get an error because DreamWeaver tries to parse the
> JavaScript as a part of the extension.
>
> I can't figure out how to get the JavaScript into the <head> of the document
> like the CSS. I've looked at numerous functions and I just can't find enough
> documentation to get a full understanding. Any help is greatly appreciated.
>


You have not given much to go on, but it might be that you did not
realize that any '</script>' tags needed to be masked from DW Extension
API by breaking them up into '</scr'+'ipt>'

--


E. Michael Brandt

www.divahtml.com
www.divahtml.com/products/scripts_dreamweaver_extensions.php
Standards-compliant scripts and Dreamweaver Extensions

www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, et alia

--
Translate
Participant
Feb 22, 2008 2:09 AM UTC
Michael,

Thanks for the reply. I find the documentation lacking, I can concede that maybe it's my understanding of what's provided, but more explanation would be better.

Simply put, I have a css that needs to be in the style tags and JavaScript that needs to be in the head, and HTML that needs to be in the body tag.

Leaving the JS out of the equation, my simple .htm file with the CSS and HTML find their appropriate spots in the doucment I'm working on.

I attempted to escape the closing script tag in the .htm file , but that doesn't work (this is where I think the documentation should explain that has to be in a .js file) , but documentation also lacks in how to get the data from the JS file back into the document.

I think my biggest issue is that I'm working from with in the DW API, which could be programmed to do what ever they want it to do, and knowing this I'm leaving the normal thought process of HTML and JavaScript, and I'm trying to guess a what could be.

I've managed to copy code and get a positive result, but it looks like I'm going to have to recode the entire .htm file and pass it as a string to the JavaScript so it will return all 3 DHTML elements to the document. That just seems like too much work.
Translate