[HTML_AJAX-devel] cross domain AJAXing

maho maho at pagema.net
Thu Dec 21 15:40:41 PST 2006


Joshua Eichorn napisał(a):
> What type of requests are you making, im not sure that the entire API 
> works using IFrame.  I'm sure that RPC style stuff that goes through a 
> server should work, but I doubt that just getting random pages will.
    Attached hello world example, slightly modified to work in php5, and 
next, changed in such way:
diff -u -r HTML.orig/js/HTML_AJAX.js HTML/js/HTML_AJAX.js
--- HTML.orig/js/HTML_AJAX.js   2006-08-29 18:46:21.000000000 +0200
+++ HTML/js/HTML_AJAX.js        2006-12-22 00:33:07.000000000 +0100
@@ -1673,6 +1673,10 @@
        // method to initialize an xmlhttpclient
        init:function()
        {
+               this.xmlhttp = new HTML_AJAX_IframeXHR();
+               this.request.iframe=true;
+               this.iframe=true;
+               return;
                try {
                        // Mozilla / Safari
                        //this.xmlhttp = new HTML_AJAX_IframeXHR(); 
//uncomment these two lines to test iframe

      Maybe I should modify something more there to let it work?

      regards

      maHo
> maho wrote:
>> Joshua Eichorn napisał(a):
>>> Look down about 10 lines.  There is a flag you also need to set.
>>> -josh
>>
>>    You mean this.request.iframe=true?
>>      I have tried to set it ... also set this.iframe=true (found 
>> somewhere in the code ... :) ) , and still no success.
>>
>>    regards
>>
>>    maHo
>>
>>> maho wrote:
>>>> Joshua Eichorn napisał(a):
>>>>> There isn't now but feel free to send in a patch with a global 
>>>>> flag on HTML_AJAX, if you act quick we can get it in 0.5.1
>>>>> -josh
>>>>
>>>>    Hmm, I think it's isn't so trivial.
>>>>
>>>>    I have tried to add:              this.xmlhttp = new 
>>>> HTML_AJAX_IframeXHR();
>>>>        return;
>>>>      at the beginning of HTML_AJAX_HttpClient, and no success. 
>>>> Requests are hanging, and then they are timed out.
>>>>
>>>>    I'm using js objects generated by generateClassStub(), if it's 
>>>> important here.
>>>>
>>>>    regards
>>>>
>>>>    maHo
>>>>
>>>>
>>>>> maho wrote:
>>>>>> Joshua Eichorn napisał(a):
>>>>>>> The iframe fallback code does work but it has some limitations 
>>>>>>> compared to using XMLHttpRequest. Also there isn't currently a 
>>>>>>> switch to force its use though I don't see a problem with adding 
>>>>>>> one.
>>>>>>> I would recommend doing something like what Julien is 
>>>>>>> suggesting, so you still have all the power of HTML_AJAX.
>>>>>> As I wrote in email sent to Julien privately (by accident, I'm 
>>>>>> sending it to list address again), I believe that Julien is wrong.
>>>>>>
>>>>>> Is there a simple way to tell HTML_AJAX library to use iframe 
>>>>>> fallback instead of XMLHttpRequest, or I will need to hack 
>>>>>> HTML_AJAX js code anyway?
>>>>>>
>>>>>> regards
>>>>>>
>>>>>> maHo
>>>>>>
>>>>>>> Julien Wajsberg wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> the usual approach is to include a javascript library from the 
>>>>>>>> site where the service is. This library can make requests to 
>>>>>>>> this site... and the code in any site can call functions in 
>>>>>>>> this library once it's loaded.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> -- 
>>>>>>>> Julien
>>>>>>>>
>>>>>>>> On 21/12/06, *maho* <maho at pagema.net <mailto:maho at pagema.net>> 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hello
>>>>>>>>
>>>>>>>> I want to cross-site AJAX calls. I mean, I want to be able to 
>>>>>>>> include
>>>>>>>> some code snippet on any page, which will send AJAX requests to my
>>>>>>>> site.
>>>>>>>>
>>>>>>>> As far I know, using cross-site XMLHTTPRequest is forbidden, and I
>>>>>>>> should look closer to iframes.
>>>>>>>>
>>>>>>>> And the question is: does HTML_AJAX properly work with
>>>>>>>> HTML_AJAX_IframeXHR, and I could use it with little 
>>>>>>>> modifications, or
>>>>>>>> it's rather experimental, and I shouldn't rely on it?
>>>>>>>>
>>>>>>>> regards
>>>>>>>>
>>>>>>>> maHo
>>>>>>>> _______________________________________________
>>>>>>>> Html_ajax-devel mailing list
>>>>>>>> Html_ajax-devel at lists.bluga.net
>>>>>>>> <mailto:Html_ajax-devel at lists.bluga.net>
>>>>>>>> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------ 
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Html_ajax-devel mailing list
>>>>>>>> Html_ajax-devel at lists.bluga.net
>>>>>>>> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tgz
Type: application/x-gtar
Size: 127879 bytes
Desc: not available
Url : http://bluga.net/pipermail/html_ajax-devel/attachments/20061222/fa6ba4f9/test-0001.gtar


More information about the Html_ajax-devel mailing list