jQuery ajax load() load data from external file

Description

jQuery ajax load() load data from external file

View in separate window

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loading Data from External File using Ajax in jQuery</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("#box").load("jquery-val.html");
    });/*from  w w  w. ja  v  a  2 s. c  om*/
});
</script>
</head>
<body>
    <div id="box">
        <h2>Click button to load new content inside DIV box</h2>
    </div>
    <button type="button">Load Content</button>
</body>
</html>



PreviousNext

Related