So, at the bottom of jQuery's main pages , it gives this example, NOTICE of how anonymous function()has no parameters. Quote jquery page says
An anonymous function does only one thing: it calls myCallBack with the values ββparam1 and param2 in the outer scope.
$.get('myhtmlpage.html', function(){
myCallBack(param1, param2);
});
So, I gave it a try, based on in this example
My code is similar to this, a similar thing, on line 10, I have anonymous function(result), but I need to add the parameter βresultβ cannot be simple function()as suggested on the JQuery website, or it will not work:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var GetResults = function (result) {
$("div").html(result);
}
$("button").click(function () {
$.get("demo_ajax_load.txt", function (result) {
GetResults(result);
});
});
});
</script>
</head>
<body>
<div>
<h2>Let AJAX change this text</h2>
</div>
<button>Change Content</button>
</body>
</html>
: JQuery , function() ? function(result), ? - ?