Results 1 to 5 of 5

Thread: Setting up files as external JS

  1. #1
    Join Date
    Sep 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Setting up files as external JS

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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.

  4. #4
    Join Date
    Sep 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by TotalHosting
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •