[jQuery] Re: Global variables in jQuery

2009-05-13 Thread Mike Nichols
'price' value won't be set until the callback completes, so try this: unction calc_matrix(x, y) { loc = "index.php?module=product"; var price = 0; $.post(loc, { "request":"xmlhttp", "action":"calc_pricematrix", "x":x,

[jQuery] Re: Global variables in jQuery

2009-05-13 Thread Danny
Are you sure the data is coming back the way you expect? Put an alert (data) in the callback function. On May 13, 3:02 am, V wrote: > I can't get global variables work, maybe somebody knows the answer > because this should be very simple. > > The following does not work, the price is not availab