Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to disable AJAX without disabling JavaScript completely?

Is it possible to disable AJAX without disabling JavaScript completely?

like image 656
Frank V Avatar asked Nov 07 '08 16:11

Frank V


People also ask

Will AJAX work if JavaScript is disabled?

Ajax call works when javascript is enabled. You can handle it by server-side scripting, when javascript is disabled, you must do works by post/get requests, so you have to recode your web application.

Does AJAX need JavaScript?

AJAX is not a programming language. AJAX just uses a combination of: A browser built-in XMLHttpRequest object (to request data from a web server) JavaScript and HTML DOM (to display or use the data)

What happens if I disable JavaScript in Chrome?

It blocks several elements on websites that include tracking cookies, thus enhancing your privacy. Disabling JavaScript can break websites too, affecting the user experience. It eliminates the possibility of a hacker injecting malicious code into the web page you browse.

What happens if I disable JavaScript on a website?

With JavaScript disabled, your browser will be able to load web pages accurately, especially older websites. Client browsers can insert malicious code into a site's JavaScript code, which can directly impact your computer or device if you visit that website.


1 Answers

If you are using Firefox, you could accomplish this with GreaseMonkey. (https://addons.mozilla.org/en-US/firefox/addon/748)

GM is a framework for applying scripts to some or all of the pages you visit. I have GM scripts that disable google-analytics downloads (because they slow things down), and which disable google-click-tracking on google result pages (because it bothers me that they are doing that).

Here is my google-click disable script:

// ==UserScript==
// @name           Google Clk
// @namespace      googleclk
// @description    Disable Google click tracking
// @include        http://*google.com/*
// ==/UserScript==
// Override google's clk() function, which reports all clicks back to google
unsafeWindow.clk = function(url) {} // { alert(url); } // I use this to test.

By doing something similar with XMLHttpRequest (and other functions) you can effectively disable them. Of course, you may completely break the page by doing this, but you already knew that.

like image 145
Peter Rowell Avatar answered Oct 20 '22 17:10

Peter Rowell