ALL the functions (load, get, post, etc) are wrappers for the $.ajax() function. I only use $.ajax() now and tweak it to meet my needs... Makes for less confusion.

Ajax by default will only load files that are in the same domain as the calling page. This is a browser security feature. (Use $.ajax() and jsonp to work around that.) So the getScript() function will follow this limitation as well if it is calling the new script via Ajax.

My thoughts.

Shawn

rickoshay wrote:
Here are the descriptions for the Ajax methods:

load -- Loads HTML from a remote file ...
ajax -- Load a remote page ...
get -- Load a remote page...
getScript -- Load and execute a local javascript file...
post -- Load a remote page...

So, if we want arbitrary HTML we have to use "load", but if we want a
whole "page" (where is that defined?)  we have to use "ajax", "get" or
"post"?

The "execute script" function (called getScript for some reason) only
works with local "files"? I believe it will work with any URI (local
or remote) returning JavaScript (assuming same origin policy of
course), and whether it came from a file isn't known to the caller.

These functions should describe the type of HTTP request they make,
and skip references to "pages" and "files".


Reply via email to