[PATCH] JavaScript XMLHttpRequest.open should throw exception

Kazuki Ohta mover at hct.zaq.ne.jp
Mon Nov 28 03:59:07 GMT 2005


Hi, All.

I continue to write Ajax program on Konqueror and found 
another imcompatible behavior. Regarding the security 
issue, XMLHttpRequest.open cannot connect to the 
different domain from the document domain.
When one tries to connect to the different domain, IE / 
Gecko / Opera throws exception but KHTML does not.
Please have a look at the example code below.

var req = createXMLHttpRequest();
try {
   req.open("GET", 'http://example.com/', true);
   req.send(null);
}
catch(e) {
 /* IE/Gecko/Opera reaches here */
  if(typeof e == 'object') {
    alert(e.message);
  } else {
    alert(e);
  }
}

Attached patch changes to throw exception like 
IE/Gecho/Opera. Please review the patch and can I apply 
this patch?

thanks in advance:-)

-------------------------------------------------
Kazuki Ohta : mover at hct.zaq.ne.jp
-------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlhttprequest-open.diff
Type: text/x-diff
Size: 776 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20051128/9c86dfdd/attachment.diff>


More information about the kde-core-devel mailing list