如何在加载函数出错时jquery Load()函数no load error.aspx页面在文件webconfig中。 [英] how to jquery Load() function no load error.aspx page in file webconfig when load function have error.

查看:58
本文介绍了如何在加载函数出错时jquery Load()函数no load error.aspx页面在文件webconfig中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目有error.aspx页面。我用load()函数获取文件文本到div标签(id resultBaiVietCon),但是当文件文件不是文件夹时,错误页面的内容加载了div标签,如何将错误页面的内容加载到挖掘标签?



My project have error.aspx page. I used load() funtion get file text to div tag(id resultBaiVietCon),but when text file is not folder, content of error page is loaded div tag, how to content of error page no load dig tag?

$(document).ready(function () {
          $("#BaiGioiThieu").click(function () {
              $("#resultBaiVietCon").load("CDBaiViet/k14/" + maSo + "/TextFile.txt", function (responseTxt, statusTxt, xhr) {
                  if (statusTxt == "success")
                      {
                     alert("External content loaded successfully!"); 
                    $("#resultBaiVietCon").show();                   
                     
                                         });
                   }
                  if (statusTxt == "error")
                       $("#resultBaiVietCon").show(); 
                       alert("Error: " + xhr.status + ": " + xhr.statusText);
              });
          });
      });





如果错误内容为#resultBaiVietCon(div标签的id)是error.aspx页面的内容



when have error content of #resultBaiVietCon(id of div tag) is content of error.aspx page

推荐答案

document )。ready( function (){
(document).ready(function () {


#BaiGioiThieu) .click( function (){
("#BaiGioiThieu").click(function () {


#resultBaiVietCon)。load( CDBaiViet / k14 / + maSo + / TextFile.txt function (responseTxt,statusTxt,xhr){
if (statusTxt == success
{
alert( 外部内容已成功加载!);
("#resultBaiVietCon").load("CDBaiViet/k14/" + maSo + "/TextFile.txt", function (responseTxt, statusTxt, xhr) { if (statusTxt == "success") { alert("External content loaded successfully!");


这篇关于如何在加载函数出错时jquery Load()函数no load error.aspx页面在文件webconfig中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆