0

is there a way to disable global events inside a JQuery $.getJSON function ?

The documentation only mention that the global property is available for an $.ajax call, but nothing about $.getJSON.

There reason I want to deactivate is that I have a global ajaxStart event that I want to not handle the async JSON file reading.

Any possible solution ? Do I have to convert the $.getJSON function to an $.ajax call ?

This is what I am trying to solve but for an async $.getJSON file event.

Codingwiz
  • 192
  • 2
  • 14

1 Answers1

0

There is no available way to disable global events in a $.getJSON.

I had to convert it to regular AJAX call from docs.

Changed this

$.getJSON(strUrl, function(response_data) {...

to this

$.ajax({
    dataType: "json",
    url: strUrl,
    global: false,
    success: function(response_data) {...
Codingwiz
  • 192
  • 2
  • 14