...

View Full Version : Finding the URL of an XMLHttpRequest object?



johnnyb
05-01-2007, 11:10 PM
Hi,

Is it possible to find what URL was last used to make a request with an XMLHttpRequest object? I've been looking in documentation but can't seem to find a place where it says if this is possible.

Thanks,

John

david_kw
05-02-2007, 07:22 AM
I see that there is a property called channel in the XHR object in FireFox. Unfortunately I did some tests and it gives a permission denied error when I try to actually read it.

uncaught exception: Permission denied to get property XMLHttpRequest.channel

Bummer.

david_kw

johnnyb
05-02-2007, 04:42 PM
Strange. It's something you would think you would be able to find out.

I guess I'll have to propogate it in an external variable, unless there's a way to add properties to built-in objects.

johnnyb
05-02-2007, 04:50 PM
Actually, you can add properties to built-in objects:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Function:prototype

I'll have to make it work in IE6, but that's a start



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum