I would like to know the specific time range for when the "script execution" setting can run under dom.max_script_run_time

I've been exploring the Firefox configuration settings related to Dom.max_script_run_time

The default value is set to 10 seconds.

My ajax timeout is also configured for 10 seconds.

I have a grasp on how ajax timeouts work, starting from sending the xmlhttp request up until the response is received. However, I'm uncertain if Firefox's Dom.max_script_run_time includes the time that ajax waits for a response.

Here's an example scenario:

1. User clicks a button on the web page.

2. The onclick event triggers (Does Dom.max_script_run_time start here?)

3. JavaScript gathers input form data and constructs JSON.

4. The AJAX request is sent using the JSON string.

5. Main JS thread completes. (Does Dom.max_script_run_time end at this point?)

6. The xmlHttpRequest object continues waiting for the server's response.

7. The xmlHttpRequest object finally receives the response from the server.

8. The response text is displayed on the web page as part of the AJAX callback. (Does Dom.max_script_run_time end here?)

Is Dom.max_script_run_time paused at the end of the main JS thread because AJAX runs in a separate thread? In other words, is script execution timed per thread?

Answer №1

The maximum execution time of a script refers to the duration during which a script is not actively running in the event loop. Its purpose is to provide users with the ability to terminate unresponsive scripts.

For instance, when conducting an asynchronous XHR request, there should be no issue (as the browser can continue processing user actions and events between the send() call and the callback execution, preventing the script from appearing inactive to the user).

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

JQuery AJAX click event not triggering

I'm currently working on a project to create a dynamic website where users can update text fields directly from the site. However, I've encountered an issue on the 'admin' page where nothing happens when the button is pressed to set the ...

Error message: It appears that the jQuery Ajax request is not being processed

I've got this snippet of code that sends a request and logs the results using console.log (I left out my key and sig). The issue is that it seems like the request is not being executed. Appreciate any help, I'm new to this and still in the lear ...

What steps do I need to take to implement a "single-instance" feature on my ASP.Net AJAX web portal?

Recently, a question came up regarding the possibility of "single-instancing" our web portal. For more information on this concept in a WinForms app, you can refer to this post on Hanselman's blog. Imagine having 2 shortcuts on the same client machin ...

Prevent rapid event triggers with a jQuery slider

I am currently working with an event function in JavaScript that involves a slider and a tooltip element. Here is the code snippet: //Hide the Tooltip initially tooltip.hide(); //Initialize the Slider slider.slider({ ...

Creating an expandable discussion area (part II)

After checking out this query that was posted earlier, I am interested in implementing a similar feature using AJAX to load the comment box without having to refresh the entire page. My platform of choice is Google App Engine with Python as the primary lan ...

Utilizing the combination of dojo.xhrPost and a Zend Framework action without the need for POST data and without the use

Attempting to send data via dojo.xhrPost to a Zend Controller Action. The data is visible in the Firebug console, but upon inspecting the post data, it appears empty. Questioning whether it's feasible to transmit an arbitrary string of data through d ...

The functionality of Jquery AJAX is operational, however, the message being displayed appears to

Inside the file changename.php, there is a DIV element: <div id="resultDiv"></div> Within the same file, PHP code can be found: <?php include_once ('connect.php'); if(isset($_POST['name'])) { $postedname = $_POST[&ap ...

Ways to prompt an error message in ajax if the search result is not found

Hey there! I'm trying to create a functionality where an error message is displayed if the result is not found, and users can enter the number with or without spaces. $(document).ready(function () { $("button").click(function () { var acc ...

Using PHP in combination with Ajax for automatically performing an action when there is an update

My goal is to have the latest value entered in the database trigger the playing of a specific song. For instance, if someone on the other side of the world selects a song on their phone, that same song should automatically start playing on all devices with ...

Modify the title attribute within a span tag in PHP using AJAX

I'm currently working with Zend Framework 2 and I have a requirement to translate a string in my index.html file, which displays a tool tip when hovering over a span tag. The challenge I face is that this value needs to change dynamically after perfor ...

jQuery when - anticipate the fulfillment of multiple success/done callbacks

When using $.when to determine when an array of ajax promises are finished, I have noticed that although the ajax calls themselves are completed when $.when fires, their callbacks and done functions are not. How can I make sure to wait for the callbacks to ...

Uploading MultipartFile with additional parameters in Spring MVC 4 using AJAX

Currently in the process of developing a file upload feature using AJAX (jQuery) and Spring MVC 4. Aside from just uploading the file itself, additional parameters such as a description need to be sent along. The approach involves an $.ajax() call to send ...

JS issue: Having trouble accessing the array values despite the array being present

I am working on an ajax call where I save the success data in an array. However, when I try to access that data outside of the ajax function and use console to log my array, it appears as expected. Here is a glimpse at what I see on the screen: https://i ...

jQuery AJAX call failing to return to page

Currently, my form is set up to upload multiple text fields and a file to a PHP script for saving. The script successfully saves the file and text fields to an SQL database. At the end of the PHP script, I have the following code snippet: ('state&apo ...

The conditional statement for ajax is malfunctioning

I am encountering an issue with some ajax coding. The if condition is not working as expected - whenever the program runs, only the else statement gets executed even when the if statement should be satisfied. <script type="text/javascript> funct ...

Traversing JSON Data using Vanilla JavaScript to dynamically fill a specified amount of articles in an HTML page

Here is the code along with my explanation and questions: I'm utilizing myjson.com to create 12 'results'. These results represent 12 clients, each with different sets of data. For instance, Client 1: First Name - James, Address - 1234 Ma ...

Sending arguments from JavaScript to PHP via ajax

I am facing a challenge where I need to send a JavaScript variable to a PHP function. While I was successful in doing this with hard-coded values, I'm struggling when it comes to using variables. Here's an example of what worked for me: <butt ...

Maximize User Engagement: Elevate Interactivity with iWebKit/iPhone Combining the Power of MySQL,

I am currently working on a chatbox that incorporates MySQL, AJAX, PHP, and Javascript technologies. Now, I would like to make this chatbox accessible on my iPod Touch/iPhone by creating a website using iWebKit. Although I have already implemented the pro ...

Using the power of AJAX, retrieve data from a PHP script and showcase the response within

Within my HTML file, I have implemented a feature that allows users to input a value. To validate this input, I created a PHP script that checks if the entered value exists in the database. The script returns the following JSON response: {"active":true} ...

"Encountering an issue with AJAX file upload displaying an error message for

Before I showcase my code, allow me to explain my objective. My goal is to create a page that updates a user's details in the database using AJAX. Initially, I successfully achieved this task. Subsequently, I wanted to enhance the functionality by inc ...