O-MI-Node/html/example/example.js
/**
 * Sends XML with AJAX POST to the server
 * @param {string} xml The XML string of the request to be sent
 * @param {Number} serverUrl The URL of the server to send the request to
 */
Sends XML with AJAX POST to the server
@param {string} xml The XML string of the request to be sent
@param {Number} serverUrl The URL of the server to send the request to
Sends XML with AJAX POST to the server @param { string } xml The XML string of the request to be sent @param { Number } serverUrl The URL of the server to send the request to
function sendAjaxRequest(xml, serverUrl) {
        $.ajax({
                type: "POST",
                url: serverUrl, 
                data: xml, 
                contentType: "text/xml",
                processData: false,
                dataType: "text",
                success: function(response){
                        console.log(formatXML(response)); 
                        console.log(parseToJson(response)); 
                },
                error: function(a, b, c){
                },
        });
}
function sendAjaxRequest ( xml , serverUrl ) { $ . ajax ( { type : "POST" , url : serverUrl , data : xml , contentType : "text/xml" , processData : false , dataType : "text" , success : function ( response ) { console . log ( formatXML ( response ) ) ; console . log ( parseToJson ( response ) ) ; } , error : function ( a , b , c ) { } , } ) ; }
Sends XML with AJAX POST to the server
 @param {string} xml The XML string of the request to be sent
 @param {Number} serverUrl The URL of the server to send the request to
Sends XML with AJAX POST to the server @param { string } xml The XML string of the request to be sent @param { Number } serverUrl The URL of the server to send the request to
/* Using the jQuery ajax shorthand function to send the POST request */ // The server url here // The request here /* response here, do something with it */ // Formatting the xml for the lulz and a cleaner structure // Check JSON parsing // Error handling if necessary