Hi Wim,

Thanks a lot. I understood when looking at your blog example with your
inputs.


On Thu, Nov 14, 2013 at 6:55 PM, Rashad M <mohammedrasha...@gmail.com>wrote:

> Hello,
>
> So If i have  a WResource hooked with application. i could call
> xmlhttp.request.open('http://localhost:8080?params=1') as of now. and in
> Wt code i could invoke the resource with the the params from
> reqest.open(..) right?.
>
> This means creating another xmlhttpreequest but this time through
> doJavascript. is that right?
>
> doJavaScript("xmlhttprequest.open('" + f->url() + "', true);");
>
> and f->url is same as http://localhost:8080?params=1
>
>
> doJavaScript("xmlhttprequest.open('+http://localhost:8080?params=1',
> true);");
>
> here the params can come from the external script or whatever.
>
> So one more question where do i call doJavaScript. because in i tried some
> std::cerr and also doJavascript('alert(0);'); but control is not reached
> there when calling from script like requst.open(url, true);
>
>
>
>
> On Thu, Nov 14, 2013 at 5:40 PM, Wim Dumon <w...@emweb.be> wrote:
>
>> Can you modify the url? Then choose it to be the url of a WResource.
>> If you cannot modify the url, deploy a global resource at that url.
>>
>> Both approaches can be used.
>>
>> BR,
>> Wim.
>>
>>
>>
>> 2013/11/14 Rashad M <mohammedrasha...@gmail.com>
>>
>>> Hello Wim,
>>>
>>> xmlhttprequest.open(furl , true); is not called from Wt its from a
>>> external js and
>>>
>>> and here the resource is a Wt application that means the furl is
>>> pointing towards a .wt application.
>>>
>>> You mentioning WResource the opposite way right?
>>>
>>>
>>>
>>>
>>> On Thu, Nov 14, 2013 at 3:52 PM, Wim Dumon <w...@emweb.be> wrote:
>>>
>>>> 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
>>>>
>>>>
>>>
>>>
>>> --
>>> 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
>



-- 
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

Reply via email to