# HTA + Jquery

 Classic List Threaded
3 messages
Reply | Threaded
Open this post in threaded view
|
Report Content as Inappropriate

 Hello I have this HTA setup so that I can fire lighthttpd for windows. After my application starts, I press a link which will fire a function that calls http://localhost/tk_project.php using Jquery's $.ajax My debugging have shown that the Ajax request ( POST and GET methods ) are resulting in a 404 error in the server's logs. When I place this address in FF it shows ok. I've searched here and came to the conclusion that I can't make cross- domain requests and probably Jquery assumes that when i'm using a local file ( file:// resource ) and trying to access a "remote" location at http://localhostIs my assumption correct and can't load anything through Jquery as i'm not allowed do make cross-domain requests? Anyone has any suggestion on how can I workaround this issue? I don't want to use vbscripting to achieve this because I use Jquery alot in this project. ) Thanks in advance. Pedro Reply | Threaded Open this post in threaded view | Report Content as Inappropriate ## Re: HTA + Jquery  If the initial page loaded from the "http://localhost" domain and you try to access a file via a "file://" URL then the browser (not jQuery) will stop you. You'd have to make the file you wanted to access available via the same domain "http://localhost" HTAs can be very different beasts to "normal" pages, so it could be something weird happening based on the security measures. Karl Rudd On Wed, Sep 24, 2008 at 5:55 AM, Jarodium <[hidden email]> wrote: > > Hello > > I have this HTA setup so that I can fire lighthttpd for windows. > After my application starts, I press a link which will fire a function > that calls http://localhost/tk_project.php using Jquery's$.ajax > > My debugging have shown that the Ajax request ( POST and GET methods ) > are resulting in a 404 error in the server's logs. > > When I place this address in FF it shows ok. > I've searched here and came to the conclusion that I can't make cross- > domain requests and probably Jquery assumes that when i'm using a > local file ( file:// resource ) and trying to access a "remote" > location at http://localhost> > Is my assumption correct and can't load anything through Jquery as i'm > not allowed do make cross-domain requests? > > Anyone has any suggestion on how can I workaround this issue? > > I don't want to use vbscripting to achieve this because I use Jquery > alot in this project. ) > > Thanks in advance. > Pedro >
Reply | Threaded
Open this post in threaded view
|
Report Content as Inappropriate

## Re: HTA + Jquery

 Hi there Karl Thank you for replying. I have the following, just to make sure that i'm not confusing anyone: 1st - I run the hta within Windows. 2nd - I call jquery to load a page from the localhost Here is someting from the server logs that might help clears things up: 127.0.0.1 localhost - [23/Sep/2008:19:36:47 +0000] "POST / tk_project.php HTTP/1.1" 404 36660 "file://E:\Projectos\WebToolkit \alpha01\index.hta" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)" Funny you should mention that is something weird is happening because I tought that normal browser security measures would not apply to HTA's since I can indeed start the webserver. Maybe HTA's don't allow cross domain requests and this is not really a Jquery issue as far I can tell... Guess I could setup document.domain but HTA complains about it.... Once again thank you for replying Karl. Regards Pedro
Loading...