Ajax post-跨域请求XDR

This is my JavaScript code to make XDR post request:

if(isIE()) {
    xdr = new XDomainRequest();
    if (xdr) {
        xdr.onerror = err;
        xdr.ontimeout = timeo;
        xdr.onload = loadd;
        xdr.timeout = 10000;
        xdr.open('POST',url);
        xdr.send('myval=abc'); 

    } 
}

And when I try to access the variable myval in PHP:

if(isset($_POST['myval'])) {
    echo 'true';
}
else {
    echo 'false'
}

I get the output as false

Could anyone help me in finding what is wrong here? Many thanks.

Try something like this:

if(isset($HTTP_RAW_POST_DATA)) {
  parse_str($HTTP_RAW_POST_DATA); // here you will get variable $myval
  if($myval== 'abc') {
  echo "TRUE !";
  }
}

You are not sending a key/value pair with XDR. You are sending a string which value is "myval=abc"