Also, if you want a GET call using load method you need
the params in the URL but in this case you expose the params
in the URL (anybody can see your request sniffing the net also
using https), and you have a size limit for params data.

using GET call:
$("#mydiv").load("myserverside.php?param1=value1&param2=value2",function(){
         // heyy!! params are comming now!!
});

using POST call:
$("#mydiv").load("myserverside.php",
                        {
                               param1:"value1",
                               param2:"value2"
                        }, function(){
            // heyy!! params are comming now!!
});



On 4/19/07, SeViR <[EMAIL PROTECTED]> wrote:


This is the jQuery inside code for load function:
load: function( url, params, callback, ifModified ) {
  [...]
        // Default to a GET request
        var type = "GET";

        if ( params )
            // If it's a function
            if ( jQuery.isFunction( params ) ) {
                [...]

            // Otherwise, build a param string
            } else {
                params = jQuery.param( params );
                type = "POST";
            }
       [...]

So, if you are sending params like {key:value} then , the ajax request
will
use POST call, in PHP debug your $_POST array:
var_dump($_POST)

GET is by default if you don't send params.


duggoff escribió:
> Thanks. I did the following with your function in a file named
> ajaxdebug.php:
>
> $('#debug').load("ajaxdebug.php",{Title:'NewCourse'});
>
> I get this: Array ( )
>
> However, when I roll my own ajax using a select that calls a custom js
> function that calls ajaxdebug.php, it shows the following:
>
> Array ( [Title] => Golf Camp ) with "Golf Camp" replaced by whatever I
> select.
>
> So it seems that .load is not sending anything to the $_GET array
> regardless of what I put in the name/value pair. Hmmmm.....
>
> Doug Gough
>
> On Apr 18, 2:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>
>
>


--
Best Regards,
José Francisco Rives Lirola <sevir1ATgmail.com>

SeViR CW · Computer Design
http://www.sevir.org

Murcia - Spain




--
--
Greetings/Saludos de SeViR
Cartagena, Murcia -Spain-
visit my web http://rincon.sevir.org

Reply via email to