Why this way is wrong ?(jquery)

$.get('myhtmlpage.html', myCallBack(param1, param2));

this is from the jquery’s document,from it’s explaination,it says that myCallBack(param1, param2) is evaluated before being passed as a function.i feel this is right,because myCallBack(param1, param2) is the second parameter of $.get(). if this is right,passing myCallBack() return’s value to it is ok. any tips would be appreciated

As this documentation said you about that. Since it is clearly said here
http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype

That the $.get() has 4 parameters and three of them are optional and second is the data to be passed to the file/url and third is the callback function which is called after successfully loaded the file and the functions will have one parameter which will hold the returned data in a certain format (xml, json, text, etc) depending upon the last parameter. So try dig into that documentation and see how it is used.

Your call back function will execute after the data has loaded from the html page.

Try this:


$.get('myhtmlpage.html',function() {
                        alert('HTML Loaded. Callback function!'); 
                        });