jQuery( document ).ready(function( $ ) {
	$( '.license' ).click(function() {
		var code = $( this ).attr( 'data-code' );
		$spinner = $( "img[data-code='" + code + "']" );
		$spinner.removeClass( 'hide' );
		jQuery.post( ajaxurl, {
            action : 'dashnex_license',
            code : code
        }, function( response ) {
            console.log( response );
            $spinner.addClass( 'hide' );
            var data = $.parseJSON( response );
            if ( data.valid ) {
            	location.href = data.redirectUrl;
            }
        });
	});
});
