-2

I need to use the 'options' object that's in this json script enter image description here

is there a way to extract it using jQuery or JavaScript?

J.g
  • 41
  • 1
  • 7

1 Answers1

0

Get the innerText of the script tag and then parse the JSON.

var options = JSON.parse(document.querySelector('script[data-drupal-selector="drupal-settings-json"]').innerText);
I wrestled a bear once.
  • 22,983
  • 19
  • 69
  • 116