我希望对 WAS 工作的东西有所了解,但现在不行,我不明白为什么。
这是在 VB 和 jquery 中使用 asp.net。
我有一个页面,上面有一个约会选择屏幕,该屏幕显示一个分支列表以及使用转发器的每个分支的可用约会数量。
单击具有规定数量的约会的块之一后,jquery 通过跨分支和日期的 ajax 调用另一个 .aspx 页面。此页面使用这些来生成显示日期的表单。通过 ajax 返回的 HTML 然后用于填充 div 的 HTML 元素,该元素显示为 JQuery 对话框。
在此对话框中是每个可用时间的链接,单击该链接后,名为 time_selected 的文本框将填充“[” & Selected_Time & “]”,名为 time_id 的文本框将填充“|” & Select_Booking_Slot_ID & "ǁ"
在对话框的初始加载中,我们有关闭事件,它获取对话框的 HTML(包括文本框)并使用日期和 ID 周围的分隔符对其进行解析,以获取我们需要的信息。
现在我强调这个 WAS 在页面的一个实例上工作,我已经创建了同一页面的移动版本,但它不再工作......还回去与原来的比较我发现原来的不再工作。
返回的 HTML 不再包含已附加的文本框的内容。
这是加载选择页面并将其放入带有关闭事件的对话框的代码,该关闭事件位于主页中。
$("a.showslots").click(function () {
$("#<%=bookingslot_branch.ClientID %>").val($(this).attr('branch'));
$("#<%=bookingslot_date.ClientID %>").val($(this).attr('date'));
$.ajax({
url: "appointment_select_small.aspx?slots=" + $(this).attr('id') + "&date=" + $(this).attr('date') + "&branch=" + $(this).attr('branchtext') + "&branchid=" + $(this).attr('branch'),
context: document.body
}).done(function (data) {
$("#Slots").html(data);
$("#Panel_Slots").dialog({
modal: true,
resizable: false,
close: function (event, ui) {
var data = $("#Panel_Slots").html();
var test_str = data;
var start_pos = test_str.indexOf('[') + 1;
var end_pos = test_str.indexOf(']', start_pos);
var text_to_get = test_str.substring(start_pos, end_pos);
var start_pos1 = test_str.indexOf('ǀ') + 1;
var end_pos1 = test_str.indexOf('ǁ', start_pos1);
var text_to_get1 = test_str.substring(start_pos1, end_pos1);
if (text_to_get.length != 0) {
$("#<%=bookingslot_time.ClientID %>").val(text_to_get);
$("#<%=bookingslot_id.ClientID %>").val(text_to_get1);
$("#<%=btn_bookingslot_click.ClientID %>")[0].click();
}
//$(this).remove();
return false;
}
}).parent().find('.ui-dialog-titlebar-close').hide();
$("#Panel_Slots").dialog('open');
$("#Panel_Slots").position({
of: window,
my: "center center",
at: "center center"
});
});
return false;
});
然后这里是约会选择小.aspx中的代码
$("a.bookappointment").click(function () {
$("#time_selected").val("[" + $(this).attr('id') + "]");
$("#time_id").val("ǀ" + $(this).attr('bid') + "ǁ");
$("#Panel_Slots").dialog('close');
return false;
});
任何帮助将不胜感激,谢谢。