<?xml version="1.0" encoding="UTF-8"?>
<NeoAppBuilderPlugIn>
  <Title>neoAjax</Title>
  <Author>SinLios</Author>
  <Website>https://sinlios.com</Website>
  <EMail>info@sinlios.com</EMail>
  <Copyright>2022</Copyright>
  <Description>Plugin to send and retrieve data to a from a serve using Ajax methods.
Version: 1.2</Description>
  <Icon20>neoajax20-icon.png</Icon20>
  <Icon32>neoajax32-icon.png</Icon32>
  <CompiledName>C:\Users\sinli\OneDrive\CloudStation\visualneo\VisualNeoWeb\Plugins\neoAjax\neoajax.nabp</CompiledName>
  <AutoInstall>yes</AutoInstall>
  <Code>function neoAjaxLoad(theUrl,theDataType,successSubroutine,errorSubroutine){
  $.ajax({
        url: theUrl,
        dataType: theDataType,
        success: function(data){
          if(successSubroutine){
            successSubroutine(data);
          }
        },
        error: function(data){
          if(errorSubroutine){
            errorSubroutine(data);
          }
        }
  });
}
function neoAjaxLoad2(theUrl,theDataType,successSubroutine,errorSubroutine,param){
  $.ajax({
        url: theUrl,
        dataType: theDataType,
        success: function(data,param){
          if(successSubroutine){
            successSubroutine(data);
          }
        },
        error: function(data,param){
          if(errorSubroutine){
            errorSubroutine(data);
          }
        }
  });
}

function neoAjaxSend(theUrl,theMethod,theData,theDataType,successSubroutine,errorSubroutine){
  $.ajax({
        type: theMethod,
        url: theUrl,
        data: theData,
        dataType: theDataType,
        success: function(data){
          if(successSubroutine){
            successSubroutine(data);
          }
        },
        error: function(data){
          if(errorSubroutine){
            errorSubroutine(data);
          }
        }
  });
}
function neoAjaxLoadEx(theUrl,headerObject,theDataType,successSubroutine,errorSubroutine){
  $.ajax({
        url: theUrl,
        headers: headerObject,
        dataType: theDataType,
        success: function(data){
          if(successSubroutine){
            successSubroutine(data);
          }
        },
        error: function(data){
          if(errorSubroutine){
            errorSubroutine(data);
          }
        }
  });
}
function neoAjaxSendEx(theUrl,theMethod,headerObject,theData,theDataType,successSubroutine,errorSubroutine){
  $.ajax({
        type: theMethod,
        url: theUrl,
        headers: headerObject,
        data: theData,
        dataType: theDataType,
        success: function(data){
          if(successSubroutine){
            successSubroutine(data);
          }
        },
        error: function(data){
          if(errorSubroutine){
            errorSubroutine(data);
          }
        }
  });
}</Code>
  <Files/>
  <ActionList>
    <Action Name="neoAjaxLoad">
      <Hint>Call an API endpoint to load content using AJAX. It sends the result to a subroutine once loaded.</Hint>
      <Params>theUrl|FILEPATH|File or data URL to load;theDataType|ENUMLIST=text,xml,html,json,jsonp,script|Data type to be loaded;successSubroutine|FUNCTION|Success subroutine;errorSubroutine|FUNCTION|Error subroutine</Params>
      <Template>neoAjaxLoad(theUrl,theDataType,successSubroutine,errorSubroutine);</Template>
    </Action>
    <Action Name="neoAjaxLoad2">
      <Hint>Call an API endpoint to load content using AJAX. It sends the result to a subroutine once loaded.</Hint>
      <Params>theUrl|FILEPATH|File or data URL to load;theDataType|ENUMLIST=text,xml,html,json,jsonp,script|Data type to be loaded;successSubroutine|FUNCTION|Success subroutine;errorSubroutine|FUNCTION|Error subroutine;param|STRING|Parameter to send as second argument to the subroutines</Params>
      <Template>neoAjaxLoad2(theUrl,theDataType,successSubroutine,errorSubroutine,param);</Template>
    </Action>
    <Action Name="neoAjaxLoadEx">
      <Hint>Call an API endpoint to load content using AJAX and Headers. It sends the result to a subroutine once loaded.</Hint>
      <Params>theUrl|FILEPATH|File or data URL to load;headerObject|STRING|Header object variable;theDataType|ENUMLIST=text,xml,html,json,jsonp,script|Data type to be loaded;successSubroutine|FUNCTION|Success subroutine;errorSubroutine|FUNCTION|Error subroutine</Params>
      <Template>neoAjaxLoadEx(theUrl,headerObject,theDataType,successSubroutine,errorSubroutine);</Template>
    </Action>
    <Action Name="neoAjaxSend">
      <Hint>Call an API endpoint to send and load content using AJAX. It sends the result to a subroutine once loaded.</Hint>
      <Params>theUrl|FILEPATH|URL to send data to;theMethod|ENUMLIST=POST,GET|Method;theData|STRING|Data object variable to send;theDataType|ENUMLIST=text,xml,html,json,jsonp,script|The type of data expected from the server;successSubroutine|FUNCTION|Success subroutine;errorSubroutine|FUNCTION|Error subroutine</Params>
      <Template>neoAjaxSend(theUrl,theMethod,theData,theDataType,successSubroutine,errorSubroutine);</Template>
    </Action>
    <Action Name="neoAjaxSendEx">
      <Hint>Call an API endpoint to send and load content using AJAX and Headers. It sends the result to a subroutine once loaded.</Hint>
      <Params>theUrl|FILEPATH|URL to send data to;theMethod|ENUMLIST=POST,GET|Method;headerObject|STRING|Header object variable;theData|STRING|Data object variable to send;theDataType|ENUMLIST=text,xml,html,json,jsonp,script|The type of data expected from the server;successSubroutine|FUNCTION|Success subroutine;errorSubroutine|FUNCTION|Error subroutine</Params>
      <Template>neoAjaxSendEx(theUrl,theMethod,headerObject,theData,theDataType,successSubroutine,errorSubroutine);</Template>
    </Action>
  </ActionList>
</NeoAppBuilderPlugIn>
