Home > DeveloperSection > Forums > How to use Load function in jquery.
Ankit Singh

Total Post:341

Points:2389
Posted on    January-19-2016 9:53 PM

 JQuery JQuery  JavaScript 
Ratings:


 1 Reply(s)
 177  View(s)
Rate this:
I want to use load function in jquery. How to use This Please help me.


aditya kumar Patel

Total Post:246

Points:1752
Posted on    January-19-2016 10:35 PM

If we have the content file in another directory and
we will have to change the parameter for the load method accordingly. This is all it takes
to load content from an external file with jQuery and the load method.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
     <div id="divContent">
        <b>Established in 2010 and headquartered in Allahabad, MindStick Software Pvt. Ltd. Our expertise is in software product design, custom programming, database design, web design and programming and cutting edge mobile applications development.</b>
</div>
 
</body>
</html>

 

 

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<script src="Scripts/jquery-2.1.4.js"></script>
<body>
      <input id="btnload" type="button" value="LoadData" onclick="return loaddata();" />  
    <div id="Loaddiv" style="width:500px;"></div>
<script type="text/javascript">
 
    function loaddata() {
        alert();
            $("#Loaddiv").load("data.html #divContent");
        }
 
</script>
</body>
</html>


Don't want to miss updates? Please click the below button!

Follow MindStick