url is undefined or empty

99 views
Skip to first unread message

sjoonk

unread,
Aug 25, 2010, 11:38:12 PM8/25/10
to easyxdm
First, I'm very thanks for your wonderful javascript library. Very
helpful!!

Second, when I use the sample xhr.html file and run in browser, "url
is undefinded or empty" error occurs.
I think it because the first parameter of Rpc method is empty, but I
don't know exactly what the problem is??

This is the sample code.

window.onload = function(){
var remote = new easyXDM.Rpc({}, {
local: {
post: function(url, data, success, error){
/easyXDM.ajax({
url: url,
method: "POST",
data: data,
type: "json",
success: success,
error: error
});
}
}
});
};

Øyvind Sean Kinsey

unread,
Aug 26, 2010, 2:52:55 AM8/26/10
to eas...@googlegroups.com

Inline..
On Thu, Aug 26, 2010 at 5:38 AM, sjoonk <sjo...@gmail.com> wrote:
First, I'm very thanks for your wonderful javascript library. Very
helpful!!

Second, when I use the sample xhr.html file and run in browser, "url
is undefinded or empty" error occurs.
I think it because the first parameter of Rpc method is empty, but I
don't know exactly what the problem is??

This is the sample code.

           window.onload = function(){// this can be removed

               var remote = new easyXDM.Rpc({}, {
                   local: {
                       post: function(url, data, success, error){
                           /easyXDM.ajax({
                                url: url,
                                method: "POST",
                                data: data,
                                type: "json",
                                success: success,
                                error: error
                            });
                       }
                   }
               });
           };
 
the xhr.html file which comes with easyXDM, and which you can find an example of usage for in /example/xhr.html exposes a method post with a signature of (string url, map data, function success [,function error]).
It's impossible for me to debug your error without knowing how you are invoking it.

Also, use the debug version while debugging. Its logs give a lot of valuable information.

Øyvind Sean Kinsey

unread,
Aug 31, 2010, 7:53:59 AM8/31/10
to eas...@googlegroups.com
I'm not sure whether you resolved this, but from looking at it again, I'm guessing that you opened the xhr.html file from the download directly, instead of letting easyXDM load it (as shown in example/xhr.html).


Øyvind Sean Kinsey
oyv...@kinsey.no
http://kinsey.no/blog/index.php/about/


2010/8/26 Øyvind Sean Kinsey <oyv...@kinsey.no>

sjoonk

unread,
Sep 1, 2010, 1:04:22 AM9/1/10
to easyxdm
That's right exactly.
And now it works well. Very thanks.

On Aug 31, 8:53 pm, Øyvind Sean Kinsey <oyv...@kinsey.no> wrote:
> I'm not sure whether you resolved this, but from looking at it again, I'm
> guessing that you opened the xhr.html file from the download directly,
> instead of letting easyXDM load it (as shown in example/xhr.html).
>
> Øyvind Sean Kinsey
> oyv...@kinsey.nohttp://kinsey.no/blog/index.php/about/
>
> 2010/8/26 Øyvind Sean Kinsey <oyv...@kinsey.no>
>
>
>
> > Inline..
> > On Thu, Aug 26, 2010 at 5:38 AM, sjoonk <sjo...@gmail.com> wrote:
>
> >> First, I'm very thanks for your wonderful javascript library. Very
> >> helpful!!
>
> >> Second, when I use the sample xhr.html file and run in browser, "url
> >> is undefinded or empty" error occurs.
> >> I think it because the first parameter of Rpc method is empty, but I
> >> don't know exactly what the problem is??
>
> >> This is the sample code.
>
> >>            window.onload = function(){// this can be removed
>
> >>                var remote = new easyXDM.Rpc({}, {
> >>                    local: {
> >>                        post: function(url, data, success, error){
> >>                            /easyXDM.ajax({
> >>                                 url: url,
> >>                                 method: "POST",
> >>                                 data: data,
> >>                                 type: "json",
> >>                                 success: success,
> >>                                 error: error
> >>                             });
> >>                        }
> >>                    }
> >>                });
> >>            };
>
> > the xhr.html file which comes with easyXDM, and which you can find an
> > example of usage for in */example/xhr.html* exposes a method *post* with a
Reply all
Reply to author
Forward
0 new messages