friends, plz post how to get a randam text from database by javascript. Whats the function to call?
Javascript function...late me know
Collapse
X
-
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:
but you will still need php/mysql to handle your database query or some other scripting languagePHP 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);
Comment
Comment