I have an issue with AJAX.
I am using Safari version 12.1.
This is my code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta rel="icon" href="assets/images/favicon.ico">
<title>Test</title>
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- GoogleFonts -->
<!-- HTML5 shiv and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>
<button>Get External Content</button>
<!-- Imported JavaScript libraries -->
<script src="assets/js/jquery-3.6.0.js"></script>
<script src="assets/js/jquery.fullpage.js"></script>
<!-- test Javascript files -->
<!--<script src="assets/js/test.js"></script>-->
<script>
$("button").click(function(){
$("#div1").load("ajaxload.html", function(responseTxt, statusTxt, xhr){
if(statusTxt == "success")
alert("External content loaded successfully!");
if(statusTxt == "error")
alert("Error: " + xhr.status + ": " + xhr.statusText);
});
});
</script>
</body>
</html>
This is the code for the ajaxload.html page
<h1>Portfolio</h1>
<p>Congratulations you have loaded content from an external page</p>
For some reason I keep on getting the error message.