Don't know if the title made any sense, but here's my problem.
I have the following code:
Code:
$.ajax({
//url: "http://sellonline.canadapost.ca:30000"
url: "test.php"
, type: "POST"
, processData: false
, data: xmlDocument
, success: function(responsed) {
alert("Returned\n---------------------\n"+responsed);
}
, error:function(xhr,err){
alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status+"\ntext: "+xhr.statusText);
alert("responseText: "+xhr.responseText);
}
});
Which, at present time works fine... the test.php only has
PHP Code:
<?php
print_r($_POST);
?>
which again works fine. Returns the xml document in the $_POST array that I sent.
However, I need to send this with the key "XMLRequest". As if the XML was in a textarea with name="XMLReqeust".
Basically, I want to do what they do here.
http://sellonline.canadapost.ca/Deve...Interface.html Only via AJAX, which should work, no?
I've tried
data: ({ 'XMLRequest': xmlDocument }) but with no success.
Is there any way to do this. I've tried searching the jQuery API but they're very limited on how this works. Thanks.