PDA

View Full Version : Why JS disable by default?


weilies
10-27-2007, 03:15 PM
hi, i come across


Content visible to registered users only.I wonder is it necessary we disable JS? What if JS enabled? will the site performance drop sharply? Coz most of my site developed are JS enable by default. All my js is loaded for each page. Is it a bad habit to do that?

Thanks

Boby
10-27-2007, 04:00 PM
We disabled it by default as we try to do most of the templates without JS. Why load the JS if you don't need it and add extra content to the site? By default we need it on the submit page when the AJAX category selection is activated, but you can turn it on if you need it everywhere, or turn it on just on pages where you need it with:
Content visible to registered users only.

weilies
10-27-2007, 04:08 PM
Hi Boby, i think this one come to design pattern issue again :)

Ya, it's true that disable JS will increase a little bit performance i think, But toggle JS on/off will make a possibility to dirty our code at the same time of optimize the little performance. So i rather enable it globally :cool:

What you think?

Boby
10-27-2007, 04:21 PM
Why is it an issue?
But hey, you are free to change your templates and code to fit your needs, most of the people want it this way as it is now.

weilies
10-27-2007, 04:24 PM
Don't get me wrong. :)
I know we all are free to change the code. I jz wana know more bout phpLD by discuss the code with senior here :p

Thanks

Boby
10-27-2007, 04:51 PM
No No, I didn't get you wrong :p
We've done it this way as we try to build the script as much as possible to work fine on large directories and directories with much traffic. Specially when you have a lot of traffic on your website, you want to save as much as possible from extra loading, putting only the JS libraries on pages where you don't need them will increase your loading times and bandwidth. No problem on regular directories.

HaHaHa, I don't see myself as senior developer yet :p junior is fine :)