Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I worry about javascript support?

Tags:

javascript

I've developed a ajax enabled site. However, the site does not currently work without javascript. The site works well on any browser that I've tested as well as iPhone/Nokia phones.

However, should I still worry about javascript support?

I know there are techniques that would get my site to work both with or without javascript, but the refactoring would require some time.

Edit: This application is targeted for our customers that will be using the the system to fill in and handle forms. Professional use mostly.

like image 703
Tom Avatar asked Jun 28 '26 21:06

Tom


2 Answers

Javascript is Huge now and since facebook and other large JS Based site, browsers have pushed out new innovations to deal with the latest web changes when it comes to JS

Because of this JavaScript is widely supported and you should not worry dramatically but it still needs to be delt with.

A Simple <noscript> tag to display a message to a user telling them they need javascript to continue

<noscript>
   Please enable javascript to use this site
</noscript>

Keep checking your analytics software such as google, mint etc to see what your visitors are using.

That will help you decide how much you have to worry about it

A way to Track non JavaScript enabled browsers is like so

<noscript><img src="noscript.php" /></noscript>

This will load a php file as an image!

the php file

<?php
   //Track the user details here inside your database or whatever so you can then see.



   //Here send back a 1x1 pixal so the DOM IS ok and to reduce load
   $pxl= imagecreate( 1, 1);
   header( "Content-type: image/png" );
   imagepng( $pxl);
   imagedestroy( $pxl);
?>
like image 130
RobertPitt Avatar answered Jun 30 '26 10:06

RobertPitt


You could display a message to users with javascript disabled saying that the site will not work properly:

<noscript>
    Hey, it seems you have Javascript disabled. Get out of my lawn!
</noscript>

If this is a big deal or not depends on your target audience.

like image 40
marcgg Avatar answered Jun 30 '26 11:06

marcgg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!