在div标签中加载aspx页面
我使用下面的代码在div标签中加载aspx页面。 但它无法正常工作。请帮我解决这个问题。
$(document).ready(function () { $('#div_more_pack').load('dss_more_pack.aspx'); }); .uc_more_pack_Cust_tab_tab_service_tree_package_0 { color:Black;font-weight:bold;text-decoration:none; }
function __doPostBack(eventTarget,eventArgument){
if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> //
//
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.'); //]]>
问题可能是page
的路径。
它应该处于同一水平。
如果他们不在同一水平那么
改成
编辑1
您可以编辑方法并查看error
$(document).ready(function () { $('#div_more_pack').load('dss_more_pack.aspx', function(response, status, xhr) { if (status == "error") { var msg = "Sorry but there was an error: "; alert(msg + xhr.status + " " + xhr.statusText); } ); });
编辑2: –
$(document).ready(function () { $('#div_more_pack').load('dss_more_pack.aspx', function(response, status, xhr) { alert(response); } ); });
尝试使用AJAX
$.get('dss_more_pack.aspx', {}, function(data) { $('#div_more_pack').html(data); });
你也可以使用
$.post('url', parameters, callback)
请参考这里