The execution of the Javascript function is not being carried out

Why is alert("Test1") being executed, but alert("Test2") is not running? P.S. I'm currently not utilizing JSON data.

<script>
$(document).ready(function() {
    var param = 10;
           $.getJSON(
                       'modules/mod_scheduler/updateList.php?param'+param,
                       function(data)
                       {
                           alert("Test1");
                           find_optimal_schedule();
                       }
           );
    });
</script>

<script language="javascript">
function find_optimal_schedule() {
    alert("Test2");
    //...
}
</script>

Answer №1

Uncertain about this, but attempt altering the following snippet:

<script language="javascript>

to:

<script type="text/javascript>

Then check if it functions properly.

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

There is no 'Access-Control-Allow-Origin' header on the requested resource, therefore the website is not permitted

I encountered an error message while loading a page: No 'Access-Control-Allow-Origin' header is present on the requested resource. The specific page causing the issue is: http://vieillemethodecorpsneuf.com/confirmation-achat-2/?item=2&cbrec ...

Obtaining data from a nested JSON using Angular4 and AngularFire2's db.list

I have a restaurant and I wanted to share a tip: Here is the JSON Structure: http://prntscr.com/gn5de8 Initially, I attempted to retrieve data from my restaurant as follows: <p *ngFor="let tip of restaurants[item.$key].tips" [innerHTML]=&qu ...

Concerns about the Dependency Tree in React

I need some assistance with my current issue. I'm having trouble installing the mui search bar component. npm i --save material-ui-search-bar Unfortunately, I'm encountering this error message: PS Z:\WebDev\ApplyWithin\frontend> ...

I am encountering an issue with my Javascript file not running due to a bigint error

I'm attempting to utilize @metaplex/js for NFT minting. Usually, my .js files function correctly, but when I execute the file, this particular error arises. bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?) The meaning of ...

NPM packages installed on a global level are not being detected

Recently, I experienced a system crash that led me to delete some files in an attempt to fix the issue. Among those files may have been ~/.profile. Since restoring my system, I've noticed that my globally installed npm packages are no longer functioni ...

Enhance the appearance of the navbar on mobile devices by customizing the styling in Bootstrap 5

Hi everyone, this is my first time posting a question here so please be gentle :) I recently implemented a script to change the CSS of my navbar when scrolling. window.addEventListener("scroll", function () { let header = document.querySelector(".navbar") ...

Building a static website with the help of Express and making use of a public directory

It seems that I am facing a misunderstanding on how to solve this issue, and despite my efforts in finding an answer, the problem persists. In one of my static sites, the file structure is as follows: --node_modules --index.html --server.js --app.js The ...

When making an HTTP GET request followed by another GET request in Express, it results in an error with undefined parameters on the

When I open a form that has a link to a list and try to access the list, I encounter an "id" undefined error for the form we came from, which was already functional. The issue arises when I have a GET page where I present a form to modify a record at /loc ...

What is the best way to display several values on a single line using `jq`?

After parsing through my json data, I've come across the following structure: { "Items": [ { "id": { "S": "c921e4eb-5958-424a-ae3a-b9cada0d9481" }, ...

Error encountered while trying to access OData feed in Tableau 8.1 due to incorrect OData format

Having difficulty connecting to an OData feed, I keep receiving this error message: "Bad OData Format. Ensure you are using a URL that directs to a valid OData Source." I am able to access the URL in a browser (and receive the correct JSON response), and ...

Looking for suggestions on AngularJS and Rails integration!

I'm currently in the process of creating a website using rails, but I want to integrate AngularJS for several reasons: Efficient sorting between 2 different types of data (such as selecting various restaurants from a list and then different food cate ...

Utilizing C in WebAssembly to return string values

Is it possible to retrieve a JavaScript string from a WebAssembly function? https://dev.to/azure/passing-strings-from-c-to-javascript-in-web-assembly-1p01 - not functional C #include <stdio.h> #include <string.h> void jsPrintString(const ch ...

Nuxt js - Components are replicated on SSR pages

I have created a static page containing various components. When I navigate to this page from another page, everything displays correctly. However, when I directly land on the page, some components are duplicated and rendered again after the footer. Upon i ...

What is the process for transferring an environment.json file to the output directory and then utilizing it with Webpack 4?

Our application is expanding with multiple environments and vendors on the horizon. While the traditional approach of running webpack --env.NODE_ENV=myenvironment works for now, it will soon become inefficient. The main objective here is to streamline the ...

Looping through items with ng-repeat and creating a submenu with M

When constructing a menu from a JSON file with submenus using the JQuery.mmenu plugin, I encountered an issue when trying to implement the submenu structure with ng-repeat. The raw HTML approach worked perfectly, but as soon as I introduced ng-repeat to dy ...

Issues with lazy loading in swiper.js when trying to display multiple images per slide

I recently tried using swiper.js and had success with the lazy loading demo. However, I encountered an issue where only one image per slide was showing up, despite wanting to display 4 images per slide. <div class="swiper-container"> <div cla ...

Exploring the manipulation of domain names and DNS records using jq

I am currently trying to grasp the concepts of jq but I seem to be facing some difficulties. Within my task, I am dealing with a dataset containing DNS records such as {"timestamp":"1592145252","name":"0.127.9.109.rev.sf ...

Transmitting information compiled into an array format using AJAX and JQuery

I'm seeking assistance with sending my data efficiently. Previously, the script I developed served as a Mass Acknowledgments Tool for Nagios, drawing inspiration from components available for NagiosXI. Initially, the data processing and sending were ...

What is the best way to implement sorting in a table using react virtualized?

I've been working on implementing sorting in my project using the table sorting demo available on Github. Here is the code I'm using: import React from 'react'; import PropTypes from 'prop-types'; import { Table, Column, Sor ...

Looking to reset the default display option in a select dropdown using JavaScript or jQuery?

Here is some HTML code for a select element: <select> <br> <option>1</option><br> <option>2</option><br> </select> This select element will initially display the first option item (display ...