Ajax jquery async return value

Posted by Sonny on Stack Overflow See other posts from Stack Overflow or by Sonny
Published on 2010-12-29T14:47:14Z Indexed on 2010/12/29 14:54 UTC
Read the original article Hit count: 318

Filed under:
|
|
|
|

Hi, how can i make this code to don't pause the browser but still return value. You can rewrite this with new method of course.

function get_char_val(merk)
{  
    var returnValue = null;
    $.ajax({   
                type:       "POST",
                async:      false,   
                url:            "char_info2.php",   
                data:   { name: merk },   
                dataType: "html",  
                success:    function(data)
                                    {
                                        returnValue = data;
                                    } 
        }); 
    return returnValue;
}
var px= get_char_val('x');
var py= get_char_val('y');

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX