Javascript function...late me know

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Javascript function...late me know

    friends, plz post how to get a randam text from database by javascript. Whats the function to call?

    #2
    which database?

    Comment


      #3
      u mean like using AJAX????


      I'm Proud to be a Sri Lankan!

      Comment


        #4
        Originally posted by Rksk View Post
        which database?
        Any database from localhost

        Comment


          #5
          Javascript is client side scripting - meaning that all scripts are run on your browser and not on the server

          you can use XMLHttpRequest to to get data:
          PHP Code:
          var xmlhttp = new XMLHttpRequest();
          xmlhttp.open("GET""http://somesite.con"false);
          xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
          xmlhttp.send(null);
          var 
          respon xmlhttp.responseText;
          alert(respon); 
          but you will still need php/mysql to handle your database query or some other scripting language

          Comment


            #6
            ok, thanks bro. Let me try

            Comment

            Working...
            X