Neither works. The first one appears to work, because you call the function jsFunc
immediately, it doesn't wait for any response.
If you create an empty jQuery object using $()
and use the load
method on that, it won't call the server because there is no element where it can put the result.
To specify the callback function you either use the name of a function:
$('#someElement').load('/my/url/', {my:data, more:data}, jsFunc);
or a function expression:
$('#someElement').load('/my/url/', {my:data, more:data}, function() { jsFunc(); });