Are simulated AJAX requests a viable solution for displaying a "wait" cursor?

While I initially wanted to use the CSS cursor property to put the user's cursor in a "wait-state" during certain actions, I encountered issues that are pushing me to explore more innovative solutions. The main problem is that the cursor doesn't change until the user physically moves it. For reference, you can visit: How to get cursor to change before mouse moves when changing the cursor style dynamically.

Upon further investigation, I discovered that most browsers effectively switch between the wait and default cursors when making AJAX requests. This led me to consider performing dummy AJAX requests for the duration I want the cursor to be in a "wait" state. Despite this potential solution, I have reservations about its effectiveness and safety. Can anyone provide insight on why this might be a risky approach? Or offer better alternatives?

Answer №1

Avoid using a waiting cursor as it can give the impression that the browser or connection is frozen.

Instead, consider utilizing various forms of waiting feedback on web pages such as progress bars, spinners, feedback text, modal windows, or disabling commands to enhance user experience.

Answer №2

Implementing this idea may be counterproductive as it could potentially overload the server with increased load and traffic.

Answer №3

After some experimentation, I stumbled upon a solution to my issue. (I'm sharing this for the benefit of future users who may encounter the same problem, as I now realize that relying on cursor feedback is generally not a good practice.)
What I discovered was that if the initial cursor change occurs within an event handler for a mouse event (such as "click" or "move"), not only does the cursor change instantly, but it will also update immediately if changed later using setTimeout or setInterval, provided that setTimeout or setInterval were invoked within that same event handler.
Strange, I know.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Reducing Image Size in JavaScript Made Easy

I need help with a project where I want the image to shrink every time it's clicked until it disappears completely. I'm struggling to achieve this, can someone assist me? Here is the HTML code I have: <html lang="en" dir="l ...

Tips for altering promises within nested for loops?

Presented below is a complex function that aims to extract model variants from a csv file, which are stored as strings in an array. The path of this csv file depends on information obtained from other csv files, hence the need for looping. The csvService. ...

What is the best way to select just the innermost row of a nested table for emphasis?

I am working on a project with multiple nested tables and I am looking for a way to highlight the innermost row below the mouse pointer. How can I achieve this? Just to provide some context, I am using nested tables to present recursive tabular data, with ...

Traverse through a series of selected options in an AJAX call to

I am facing a dilemma with a multiple select item, as it allows me to choose and send multiple selected items via an ajax request for importing into my database. The challenge lies in looping through the array received from the POST request. Ajax Request ...

How can I stop a user from navigating through links or submitting forms using jQuery?

I'm exploring the idea of converting my website into a Single Page Application. One challenge I am facing is capturing the navigation process, for example: <a href="myData.php">Change My Data</a> When a user clicks on the "Change My Data ...

What could be the reason behind my Razor controller action failing to work when invoked through Ajax within a JavaScript function?

I am encountering an issue with my Asp.NetCore Razor application. I am trying to call a controller action using $ajax() but the action is not reaching the controller. I suspect there might be a problem with how the @Url.Action() is configured in the javasc ...

Modify the width measurement from pixels to percentage using JavaScript

Looking for some help with a content slider on my website at this link: . I want to make it responsive so that it adjusts to 100% width. I managed to make it responsive by tweaking some code in the developer tools, but now I'm stuck. The bottom two p ...

Unable to acquire lock, the bot is still sending requests rapidly. Code written in PHP with the use of AJAX

Yesterday, I raised an issue about my betting site being exploited by someone using a bot to press "Roll" repeatedly in quick succession to manipulate the roll numbers. Here's the thread discussing how to stop bots from sending multiple requests quic ...

Sending a data value from a Controller to jQuery in CodeIgniter

Getting straight to the point. Check out some of the functions from my Student Model: public function get_exam_data($exam_id){ $this->db->select('exam_id, exam_name, duration'); $this->db->from('exams'); $this- ...

What steps can be taken to resolve the issue of the Cannot POST /index.html error?

Here is an example of a calculator app created using HTML and Javascript. Upon running the program with nodemon and accessing localhost:3000, pressing the submit button triggers an error on Google Chrome. [nodemon] starting `node calculator.js` Server sta ...

Issues with AJAX causing MYSQL to get NULL data inserted

My HTML code collects latitude and longitude coordinates and sends them to a PHP script using AJAX. However, the issue is that the AJAX request inserts NULL values into the database table. It seems to be inserting "0.000000" for both Latitude and Longitude ...

Combining a variety of animations within a mesh

Can someone help me understand this specific example in Three.js? The link is . I am facing some difficulties with the BlendCharacter.js file. this.load = function ( url, onLoad ) { var scope = this; var loader = new THREE.JSONLoader(); load ...

Guide on invoking a JavaScript function within a jQuery upon a specific event, such as clicking a hyperlink

I have a website page where I display some important information. However, I want to make this text hidden initially and only visible when a user clicks on a specific link or button. I attempted to achieve this functionality using the following code snippe ...

The fetch API is being restricted, however, AJAX and XHR are still operational

I made an API call to a URL shortener and encountered different responses using Fetch, JQuery, and XHR. Why is Fetch returning a 400 error while the other methods work smoothly? Even after trying mode: 'no-cors' and "crossDomain": true in the re ...

I am experiencing an issue with my date filter where it does not display any results when I choose the same date for the start and end dates. Can anyone help me troub

Having an issue with my custom filter pipe in Angular. When I select the same dates in the start and end date, it doesn't display the result even though the record exists for that date. I've noticed that I have to enter a date 1 day before or ea ...

Getting an error response with a status of 200 when making a jQuery ajax call

After sending a jQuery ajax request to my express-powered node.js server, everything seemed to be in order. However, to my surprise, the response invoked the error callback instead of the success callback, despite receiving a status code of "200". It was d ...

Incrementing a variable based on a condition in JavaScript

Currently, I am working on a project where I have a variable called "total" that needs to be assigned a number (or price) and then incremented when certain options are selected or checked. Below is the code that I have developed up to this point. This sni ...

What is the process for generating an Electronic Program Guide for television?

Welcome to the forum! I'm a front-end developer at a company for 6 months now, currently working on a TV app. It's my first experience in this field and I'm facing some challenges, particularly with creating an epg for the app. Unfortunately ...

Show a Kendo Pie Chart that reflects information from the grid dataset

I am using KendoUI - Grid component Is there a way to transform this into a Kendo Grid? For example: I have set up a Kendo grid (table) with local data. When I click on the "Generate chart" button, I want the filtered data from the table to be used to cr ...

Tips for identifying selected rows in Material UI DataGrid

Currently, I am in the process of developing a website using React along with Material UI. My main focus right now is to identify which rows are currently selected in my DataGrid. To achieve this, I want to populate an array with the selected rows using t ...