$("#callback_complexdemo>#button3").click( function load(){ var whereAmI = $(this); $.get("example.html",{ 'param[]': ["var1", "var2"] }, function f3(data) { console.log(whereAmI); $('div',$(whereAmI).closest('div')).html(data); } ); } );
希望通过这个小例子,能让大家学会如何给AJAX回调函数传递额外参数,以及实用且重要的上下文参数。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn