How to temporarily disable javascript AFTER page loading?

I want to disable Javascript after the page is already loaded.

Why?

Because I want to check how the behavior of something like β€œworsens” when javascript is not available, but I do not want hastle to switch to the Javascript enable / disable function at the top level of the browser. In addition, I specifically want to disable it after the page has loaded , because I want to isolate my testing before this form runs (I have jQuery for the rest of the page, and I don't want to lose this).

Letting me disable JS for this code, I can check the form postback as well as AJAX postback.

<form action="/pseudovirtualdirectoryfortesting/company/Contact" id="fooForm" method="post" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, loadingElementId: 'submitting', onBegin: Function.createDelegate(this, submitComments_begin), onComplete: Function.createDelegate(this, submitComments_complete), onFailure: Function.createDelegate(this, submitComments_failure), onSuccess: Function.createDelegate(this, submitComments_success) });">

What plugins or tactics can I use. I want to be able to test in different browsers, and some of the projects I'm working on are designed for only one browser (and not for my error), so I need as many possible solutions as I have.

+6
javascript ajax
source share
3 answers

Download the web developer toolbar for Firefox. With it, you can disable Javascript at any time, disable cookies, css, everything you need.

+6
source share

Testing in FireFox using the NoScript add-on.

+2
source share

This is not an answer to the general question "how to disable javascript", but it was a good solution for me.

I stopped using Microsoft AJAX instead of jQuery.

As a result of this, I use unobtrusive javascript, and therefore it is much easier to disable only the AJAX handler for my form than with Microsoft Ajax.

All I do is comment out the line that connects the AJAX call to my submit button.

-one
source share

All Articles