私はこのコードを持っています
<input type='submit' name='sub_form' value='Save'>
と<a href="#" class="close">Cancel</a>
そしてjQueryは
$('td.add_text').click(function(e) {
$('<img src="images/ajaxLoader.gif" id="loading" style="width:auto;" />').appendTo(".quotation_computation");
//Cancel the link behavior
e.preventDefault();
//Get the A tag
var ccom = $( 'input[name=com_code]' ).val();
var ucom = $( 'input[name=user_code]' ).val();
var in_form = $( 'input[name=in_form]' ).val();
var ctrack = $( 'input[name=com_for_track]' ).val();
$.ajax({
type:"GET",
url:"forms/tem.php",
data: {uc: ucom, cc: ccom, ct: ctrack, in_f: in_form },
dataType: 'html',
target: '.quotation_computation',
success: function(data){
$(".quotation_computation").find('img#loading').remove();
$(".quotation_computation").html(data);
}
})
});
そして閉じるボタンjquery
$(".close").click(function () {
$(".quotation_computation").hide();
});
そしてhtml
<div class="quotation_computation">
ANOTHER JQUERY PROBLEM
</div>
閉じるボタンをクリックしても機能しません。
私の閉じるボタンは間違っていますか?okie をクリックするとdiv class="quotation_computation">
、jquery ajax が正常に動作し、データベースに保存されます。しかし、Cancel
ボタンをクリックすると、jquery ajaxまたはフォームがまだそこにあります。
変更する必要があるものはありますか?