您好如何在输入字段中显示加载结果?
<input type="text" placeholder="1" name="bah" style="width:70">
我希望将5替换为输入值
result = load( "tt.php", { "query":"bt","number":5} );
return $('input[name="bah"]').val(result);
祝你好运
答案 0 :(得分:0)
http://api.jquery.com/jquery.get/试试这个
$.get( "tt.php",{param: 'test'},function( data ) {
$('input[name="bah"]').val(data.number);
});
or
$.ajax({
type: 'get',
url: 'tt.php',
dataType: 'json',
data: { param: 'test' },
success: function(data) {
$('input[name="bah"]').val(data.number);
}
});