Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to fetch server data into a div using jquery

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.58k
    Comment on it

    Hi, in this blog you will learn how the load function in jquery, Used to fetch data from any server to any web page using selectors.

    <p><script>
        $(document).ready(function(){
            $("button").click(function(){
                $("#div2").load("your&#95;text&#95;file.txt");
            });
        });
        </script></p>
    

    This script is also used to load function by calling the url/name of the target file. But just before this function you need to set the position on which the data will popup. Lets create a div give name "div2", And you can see exp $("div2") showing position of remote data.

    <div id="div2"><h2>Portion below this line will show the server page data.</h2></div>
    
    <button>show data</button>
    

    Since this is google product all you need to call the CDN jquery .

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"> </script>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: