Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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?

JavaScript
$(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);
              });
          });
      });


when have error content of #resultBaiVietCon(id of div tag) is content of error.aspx page
Posted
Updated 23-Oct-14 17:25pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900