PDA

View Full Version : Setting up files as external JS



TotalHosting
09-05-2006, 03:21 AM
Since the preferred method of using a complex JS is to make an external reference file, why are all the DD scripts still of the "stick this in the HEAD" variety of internal scripts?

Don't get me wrong, the scripts are great. But it would be very helpful to have them pre-stripped and slashed properly for external usage.

Just a general comment. Otherwise, keep up the great work!

Pete

jscheuer1
09-05-2006, 03:58 AM
I'm not officially associated with Dynamic Drive but, I can think of one possible reason. Dynamic Drive seems to be targeted for the novice as well as the experienced script user. With novices, once you start telling them to save this file as this and to link it here like that and to be sure to get the script's internal paths (if any) correctly configured, etc. - many of them get lost. For experienced users, such as yourself, it should be a simple matter to turn any javascript into an external resource.

ddadmin
09-05-2006, 04:43 AM
There's no particular reason why scripts are exposed as inline rather than external .js files on DD. Like John said, I've always thought anyone who's savvy enough to demand that a script be in the form of an external file probably will know how to do this by him/herself. On the other hand, for novices, there's nothing easier than cutting and pasting inline code, not to mention for me to help debug it on their page if there's a problem.

TotalHosting
09-07-2006, 03:53 AM
Well, I am not *demanding* anything ;-)

It just seems that this fosters bad habits, and clutters up the top of the page with inline code, which may not be necessary.

I didn't think of it from a support standpoint, though the external js would still be readible.

Anyways, just a thought.

And thanks again for the great work, overall.

Pete

jscheuer1
09-07-2006, 06:17 AM
Well, I am not *demanding* anything ;-)

That's fortunate. :)


It just seems that this fosters bad habits, and clutters up the top of the page with inline code, which may not be necessary.

There is always a line (sometimes a fine line) between that sort of thing and actually enabling someone to do a thing at all.


I didn't think of it from a support standpoint, though the external js would still be readible.

It's almost always always easier to troubleshoot a single file though.


And thanks again for the great work, overall.

Yes, I think Dynamic Drive (with which I am not affiliated) does a fantastic job.