Do you use external javascript?
I've been using external stylesheets for years but have never taken the leap with javascript (with the exception of dhtml modules0
I'm now asking myself: why not? I just tested things out by externalizing my menu rollovers and they work like a charm in 4 different browsers. Why haven't I been doing this before now?
Am I just a slave to routine or was there a valid reason that I'm forgetting?
.....
cadeh posted this at 16:51 — 19th April 2002.
They have: 33 posts
Joined: Apr 2002
I'm gonna say slave to routine. You know the saying, "If it ain't broken, don't fix it."
taff posted this at 17:00 — 19th April 2002.
They have: 956 posts
Joined: Jun 2001
aah, but you see, it is broken! and now I have to search and replace through a 40 page web site to fix all occurrences of it.
Nope, I think it's high time I got dragged kicking and screaming into the 21st century
.....
doublehelix posted this at 17:40 — 19th April 2002.
They have: 117 posts
Joined: Feb 2002
I use external js files all the time, but one thing about them has always bothered me. If you do a view source in some versions of IE you only see the call to the js, not the html that gets generated by the js. I'm thinking that the navigation must be broken in readers as a result. I'm trying to get a meeting set up with a service that uses readers to check a site of mine, and that is one of the issues I've set up to be tested.
mairving posted this at 17:47 — 19th April 2002.
They have: 2,256 posts
Joined: Feb 2001
I usually just have a header file that contains the head section and usually the navs. Then I just include this header file in the page. That way either external or internal JS, I only have to change it once.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
taff posted this at 18:25 — 19th April 2002.
They have: 956 posts
Joined: Jun 2001
mairving: You are referring to server side includes? That is something else I'd like to delve into more. Two things prevent me from it..
1/ it is a pain in the neck to test on a local machine unless I run some sort of server setup
2/ quite often, either the client's host does not support ssi or it is an unknown factor at the time of the design
.....
mairving posted this at 19:02 — 19th April 2002.
They have: 2,256 posts
Joined: Feb 2001
I am talking about using PHP not SSI. You can set up an Apache server on your box with PHP/MySQL. I build all my pages on my local machine and then upload them.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
Megan posted this at 19:31 — 19th April 2002.
She has: 11,421 posts
Joined: Jun 1999
And that's easy! Even I could do it
Includes make life SO much easier that any kind of effort to check for host support would certainly be worth it. SSI or PHP... And I would assume that your host supports SSI unless you've got some crappy freebie deal.
Megan
Connect with us on Facebook!
openmind posted this at 19:46 — 19th April 2002.
He has: 945 posts
Joined: Aug 2001
I must admit I only use JavaScript includes when I have a bit of script that is reused many times. Other times I just right the script straight in...
Suzanne posted this at 20:06 — 19th April 2002.
She has: 5,507 posts
Joined: Feb 2000
No JavaScript is written to the file -- only server-side scripting is written to the file. JavaScript is always written to the browser/reader.
dk01 posted this at 14:20 — 20th April 2002.
He has: 516 posts
Joined: Mar 2002
Anyone use external Javascripts that are in a server parsed page?
for example:
<script language="Javascript" src="http://www.conxiondesigns.com/tools/counter.asp">
</script>
I used this to write server parsed javascript for pages that do not allow and severside languages. I have found that its pretty effective but I am not sure if it is looked apon as "bad practice" or anything. Any comments on this?
-dk
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.