PDA

View Full Version : Creating DHTML as an external file & accessing it.



BryGuy
03-25-2008, 07:43 PM
Cool DHTML Tooltip II
http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm

I successfully implemented this code and everything is working, but I have related question to this script.

Is there a way to save the body code as a js file and access it externally?

I have a blog on my own domain run through WordPress, and all the other javascripts are saved as a "name.js" and located in a folder on my server. What do I have to do to be able to use "DHTML Tooltip II" externally?

I'm a bit of a noob when it comes to coding and website design.....but I'm trying.

Here's what I tried:
1. I inserted the stylesheet into my existing CSS file.
2. I opened a pre-existing js file, deleted the code, cut and paste the "Cool DHTML Tooltip II" code (that would normally be pasted into the body) & pasted it into the opened js file. I renamed the file "ddrivetip.js" and saved it.
3. I uploaded the "ddrivetip.js" file to my server to "www.websitename.com/js/ddrivetip.js"
4 In the header I inserted the following code "<script type="text/javascript" src="www.websitename.com/js/ddrivetip.js"></script>"

After doing the above 4 steps my link shows up as normal, but the "DHTML Tooltip II" code doesn't preform its function.

What did I do wrong? I'm sorry if this is a really lame question.

BryGuy
03-25-2008, 08:18 PM
Found my answer HERE (http://www.dynamicdrive.com/forums/showthread.php?t=30023&highlight=external+dhtml)