我是Jquery的新手,想要了解我正在开发的rails应用程序。我有一个电子邮件表单,您可以在其中发送发票,收件人可以对发票提出异议,但争议发送表格给出了500错误,
PFQuery *query = [PFQuery queryWithClassName:@"ParseClassYouWantToGet"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{
if (!error)
{
for (PFObject *object in objects)
{
NSLog(@"%@", object)
[parseDict setObject:tmpObject forKey:tmpKey];
}
return;
}
NSLog(@"%@",error.localizedDescription);
}];
和
xhr.send( ( s.hasContent && s.data )
当我刷新页面时,正在记录操作,发票显示为有争议,但是应该发生的操作(实际发送注释和成功消息)不会发生。
这是相关的js.erb文件
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
这是HTML文件的相关部分
jQuery('#dispute_invoice_popup').modal('hide');
jQuery(".alert.alert-success").show().find('span').html("<%= escape_javascript @message %>");
jQuery('.response_to_client').html('<%= escape_javascript render("dispute_history") %>');
jQuery('#show_invoice_container').html('<%= escape_javascript render("show_invoice") %>');
这些在js.coffee文件中
<div class="dispute_popup">
<%= form_tag "/invoices/dispute_invoice",:class=>"dispute_form",:novalidate => "", :remote => true do %>
<div id="dispute_invoice_popup" class="modal hide fad" style="width:760px; min-height: 250px; left:43.4%;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="model_grey_container">
<div class="modal-header">
<h1><%= t('views.invoices.dispute_invoice') %></h1>
<div class="cross_btn">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<%= image_tag "cross.png", :size => "7x7", :alt => "" %>
</button>
</div>
</div>
<div id="invoice_popup_error" class="alert alert-error popup" style="display:none;">
<button class="close" type="button" style="margin:0px;">×</button>
<table>
<tbody>
<tr>
<td>
<span></span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-body">
<%= hidden_field_tag "invoice_id", @invoice.id %>
<div class="fields_content_data new_invoice_fields">
<div class="field_row textarea">
<div class="label_field textarea"><label><%= t('views.invoices.reason_for_dispute') %></label></div>
<div class="large_field" style="clear:both;">
<%= text_area_tag "reason_for_dispute" ,'',:required => ""%>
</div>
</div>
</div>
</div>
<div class="footer ">
<%= submit_tag t("views.common.send"), :class => "btn_large submit" %>
<a class="btn_large grey" href="#" data-dismiss="modal"><%= t('views.common.cancel') %></a>
</div>
</div>
</div>
正如我所说,我是Jquery的新手,我真的很茫然,我真的很感激任何帮助或建议。如果您可能需要任何其他信息,请与我们联系。