[jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Chris W. Parker
Hello, Considering the following two statements: 1: $(div#one).load('numbers.php', {page: thisPage}); 2: $.get('numbers.php', {page: thisPage}, function(fileInput) { $(div#one).html(fileInput); }); Why does #2 work and #1 doesn't? As far as I know I'm using #1 correctly. The problem

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Chris W. Parker
On Tuesday, October 31, 2006 1:57 PM Chris W. Parker said: 1: $(div#one).load('numbers.php', {page: thisPage}); 2: $.get('numbers.php', {page: thisPage}, function(fileInput) { $(div#one).html(fileInput); }); Why does #2 work and #1 doesn't? I found out why. Apparently I

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread jyl
Thats amazing.. I was just puzzling over the exact same problem. I switched all my code to use explicit get which is better anyways, because I want to update more than one DOM element with results returned from the server. Live and learn. What are the three places where we should look for docs?

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Klaus Hartl
[EMAIL PROTECTED] schrieb: Thats amazing.. I was just puzzling over the exact same problem. I switched all my code to use explicit get which is better anyways, because I want to update more than one DOM element with results returned from the server. Live and learn. What are the three

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Aaron Heimlich
On 11/1/06, Klaus Hartl [EMAIL PROTECTED] wrote: load does both get and post, kind of autodetecting depending on thearguments passed in...:Why does load() do a POST? You're not submitting any data to the server, only asking for some. ___ jQuery mailing

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Klaus Hartl
Aaron Heimlich schrieb: On 11/1/06, *Klaus Hartl* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: load does both get and post, kind of autodetecting depending on the arguments passed in...: Why does load() do a POST? You're not submitting any data to the server, only asking

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Aaron Heimlich
On 11/1/06, Klaus Hartl [EMAIL PROTECTED] wrote: Aaron, not if you pass in data as a second argument:$(#feeds).load(feeds.html, {test: true});I'm having a little trouble understanding why you want to even do a POST using load() when query variables would do just fine. An example would be greatly

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread jyl
On 11/1/06, Klaus Hartl [EMAIL PROTECTED] wrote: Aaron, not if you pass in data as a second argument: $(#feeds).load(feeds.html, {test: true}); I'm having a little trouble understanding why you want to even do a POST using load() when query variables would do just fine. An example would

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Chris W. Parker
On Wednesday, November 01, 2006 11:11 AM [EMAIL PROTECTED] said: What are the three places where we should look for docs? Well there's: 1. Visual jQuery http://www.visualjquery.com * 2. API Documentation http://jquery.com/api/ * 3. The third place are the wiki pages that can be found on the

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Aaron Heimlich
On 11/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: A couple of points come to mind:* Suppose the URL already has a query string and you want to add a fewmore arguments... Better to let jQuery deal with the parsing and decidinghow to send it.* Same argument but this time you want the variable

Re: [jQuery] Why does $.get() work but not load()?

2006-11-01 Thread Blair McKenzie
Because a get request is more restrictive (character codes in the url, maximum request size) than post. Therefore, by default, the relatively permissive hash is converted to post format. Load is a generic solution. If you want more control of your request, you need to use a more specific function.