HOW TO USE LOAD FUNCTION IN JQUERY.

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
 416  View(s)
Ratings:
Rate this:
I want to use load function in jquery. How to use This Please help me.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: How to use Load function in jquery.

    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>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!