Disabled Javascript

Jan 8, 2013 at 6:42 PM

I was hoping to pick your brains about supporting browsers with no JavaScript...

 

I noticed that when JavaScript is disabled, the html for the entire application gets downloaded to the client, even the areas not currently being viewed.  This happens on every post-back, which I would imagine could make performance unnecessarily bad.  Was this intentional?  You talked a lot about the difficulties with Content Retrieval Decisions (Ch 7).  Did this factor into it as well?  Would you say it is reasonable to tell users to enable JavaScript or the application will perform badly?  Do you think there is a reasonable way to only send the minimal amount of html or is it not worth worrying about?  What is your opinion of just telling users the app will not work at all if JavaScript is disabled?

Developer
Jan 10, 2013 at 5:49 PM

Hi,

Based on my understanding, it seems like the reason for using this approach could be related to the drawbacks mentioned in the Content Retrieval Decisions in Mileage Stats section of the documentation, particularly to the drawbacks of giving the widgets URLs to request partial views as needed:

"This had a number of drawbacks. First, it increased the surface area of the server by exposing the additional endpoints the widgets needed to request the necessary HTML fragments. Second, the number of Ajax calls made by the client increased because each widget needed to retrieve both the required data and the partial views. The increase in calls also created additional failure points and made the error handling code for the widgets more complex."

Hence, it seems that the layout page contains all the templates, scripts and so on in order to avoid the aforementioned drawbacks. As you mentioned this could cause some overhead when JavaScript is disabled, in which case you may have to decide which approach suits best for your scenario.

Regarding, notifying the requirement of JavaScript, I think, It's reasonable to communicate this requirement to the users for example by including this notification in the initial HTML and hide this notification in the first action the application script takes, in order to keep it only when the client browser does not support it.

On the other hand, the possibility of telling the user that the application will not work without JavaScript, I believe it will entirely depend on the specific functional requirements of each application.

Regards,

Agustin Adami
http://blogs.southworks.net/aadami