summaryrefslogtreecommitdiff
path: root/openstack_dashboard
diff options
context:
space:
mode:
authormanchandavishal <manchandavishal143@gmail.com>2023-04-10 18:36:41 +0530
committerVishal Manchanda <manchandavishal143@gmail.com>2023-04-10 13:18:06 +0000
commitde61e2a0493d6eea25ddb9c26a208064ea22d516 (patch)
treeb202113a91ccd1944f373f3b25cb847e25836cde /openstack_dashboard
parent7d44796eca10fa61d4d98ab98358c5932746734e (diff)
downloadhorizon-de61e2a0493d6eea25ddb9c26a208064ea22d516.tar.gz
Fix Deprecated: jQuery.parseJSON() warning by updating to JSON.parse()
The jQuery.parseJSON() method has been deprecated since jQuery 3.0, and generates a warning in the console. This patch replaces all instances of jQuery.parseJSON() with JSON.parse(), as recommended in the jQuery upgrade guide [1]. This ensures that the code is compatible with the latest version of jQuery and eliminates the warning. [1] https://jquery.com/upgrade-guide/3.0/#deprecated-jquery-parsejson Change-Id: I1da5a6c56cefe9bbe0c1185ac8c536eb8f2a6a35
Diffstat (limited to 'openstack_dashboard')
-rw-r--r--openstack_dashboard/static/js/horizon.networktopology.js2
-rw-r--r--openstack_dashboard/static/js/horizon.networktopologycommon.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/openstack_dashboard/static/js/horizon.networktopology.js b/openstack_dashboard/static/js/horizon.networktopology.js
index c94da2953..ef024692d 100644
--- a/openstack_dashboard/static/js/horizon.networktopology.js
+++ b/openstack_dashboard/static/js/horizon.networktopology.js
@@ -157,7 +157,7 @@ horizon.network_topology = {
self.translate = null;
});
angular.element(window).on('message', function(e) {
- var message = angular.element.parseJSON(e.originalEvent.data);
+ var message = JSON.parse(e.originalEvent.data);
if (self.previous_message !== message.message) {
horizon.alert(message.type, message.message);
self.previous_message = message.message;
diff --git a/openstack_dashboard/static/js/horizon.networktopologycommon.js b/openstack_dashboard/static/js/horizon.networktopologycommon.js
index a2722e8fe..417b028dc 100644
--- a/openstack_dashboard/static/js/horizon.networktopologycommon.js
+++ b/openstack_dashboard/static/js/horizon.networktopologycommon.js
@@ -88,7 +88,7 @@ horizon.networktopologymessager = {
// listens for message events
angular.element(window).on('message', function(e) {
- var message = angular.element.parseJSON(e.originalEvent.data);
+ var message = JSON.parse(e.originalEvent.data);
if (self.previous_message !== message.message) {
horizon.toast.add(message.type, message.message);
self.previous_message = message.message;