Use JQuery to Write Data to a Variable

Saturday, April 25, 2020

Needed a way to put data pulled from my API (via Django REST Framework) into a variable for graphing.

    getValues: function(url) {
        var result = null;
            url: url,
            method: 'GET',
            async: false,
            success: function (data) {
                result = data;
        return result;

Using this I can make a simple call in my scripts and pull back the data I need (in this case for generating graphs using

var something = $.getValues('/api/something')

CentOS 8 Software RAID Monitoring

Quick API Auth for Flask