How do I animate Load as soon as I load?
Is there any way to optimize this code? For example if I have 30 links on the pages.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script><script>$(document).ready(function(){$("#link-1").click(function(){
$("#div1").load("teste.html").fadeIn('1500');
});
$("#link-2").click(function(){
$("#div1").load("teste-2.html").fadeIn('1500');
});
});
</script>
</head>
<body>
<button id="link-1">Get External Content</button>
<button id="link-2">Get External Content</button>
<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>
</body>
</html>