f = new WFileResource(....);
....
doJavaScript("xmlhttprequest.open('" + f->url() + "', true);");
This will use a session-bound resource, so the URL will contain a secret
that identifies the current session.
Or you can deploy your resource at a fixed location (so-called global
resource), in which case anyone/anything can access the URL.
BR,
Wim.
2013/11/14 Rashad M <mohammedrasha...@gmail.com>
> Hello Wim,
>
> I didnt get it. How will I get the url of WResource before running it.
>
> Maybe my question was not asked in proper way. I have a javascript file
> which call a Wt application
> http://localhost:8080/?id=10
>
> When I call this from browser thats fine. I can see the id is read from
> env.Parameter() and can do the processing in Wt.
>
> But when I do
>
> xmlhttprequest.open('http://localhost:808/?id=10',true);
>
> Noting happens but In the terminal and firebug console
>
> it shows the request
>
> 127.0.0.1 - - [2013-Nov-14 15:09:33.983389] "GET /?id=10&wtd=asasasas
> HTTP/1.1" 200 2069
>
>
>
> On Thu, Nov 14, 2013 at 3:17 PM, Wim Dumon <w...@emweb.be> wrote:
>
>> Yes. Use the url of a WResource as URL in the XMLHttpRequest.
>>
>> BR,
>> Wim.
>>
>>
>>
>> 2013/11/14 Rashad M <mohammedrasha...@gmail.com>
>>
>>> Hello,
>>>
>>> Is it possible to send an xml http request to Wt application and receive
>>> a response text like php
>>>
>>> var request = new XMLHttpRequest();
>>> var url = 'http://localhost:8080' + '?' + params;
>>> request.open("GET", url ,true);
>>> request.send( null );
>>>
>>>
>>> request.onreadystatechange = function() {
>>>
>>> if (request.readyState==4)/* && request.status==200) */ {
>>>
>>>
>>> //something to do with output data from a Wt Application!!!
>>> //Is this possible??
>>>
>>> }
>>> }
>>> --
>>> Regards,
>>> Rashad
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>>> Free app hosting. Or install the open source package on any LAMP server.
>>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> witty-interest mailing list
>>> witty-interest@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>> Free app hosting. Or install the open source package on any LAMP server.
>> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> witty-interest mailing list
>> witty-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>
>>
>
>
> --
> Regards,
> Rashad
>
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest