What is AJAX?
AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS, and Java Script.
CREATE TABLE 'ajax_example' ( 'name' varchar(50) NOT NULL, 'age' int(11) NOT NULL, 'sex' varchar(1) NOT NULL, 'wpm' int(11) NOT NULL, PRIMARY KEY ('name') )
<html> <body> <script language = "javascript" type = "text/javascript"> <!-- //Browser Support Code function ajaxFunction() { var ajaxRequest; // The variable that makes Ajax possible! try { // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e) { // Internet Explorer Browsers try { ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { // Something went wrong alert("Your browser broke!"); return false; } } } } //--> </script> <form name = 'myForm'> Name: <input type = 'text' name = 'username' /> <br /> Time: <input type = 'text' name = 'time' /> </form> </body> </html>
<h1>WELCOME TO FIREBASE TUTORIALS APP</h1>
npm install -g firebase-tools
firebase login
firebase init
firebase deploy
{ "rules": { "users": { "$uid": { ".write": "$uid === auth.uid", ".read": true } } } }
{ "rules": { "foo": { ".validate": "newData.isString()" } } }
var connectedRef = firebase.database().ref(".info/connected"); connectedRef.on("value", function(snap) { if (snap.val() === true) { alert("connected"); } else { alert("not connected"); } });
firebase.auth().signInAnonymously() .then(function() { console.log('Logged in as Anonymous!') }).catch(function(error) { var errorCode = error.code; var errorMessage = error.message; console.log(errorCode); console.log(errorMessage); });
<button onclick = "githubSignin()">Github Signin</button> <button onclick = "githubSignout()">Github Signout</button>
var provider = new firebase.auth.GithubAuthProvider(); function githubSignin() { firebase.auth().signInWithPopup(provider) .then(function(result) { var token = result.credential.accessToken; var user = result.user; console.log(token) console.log(user) }).catch(function(error) { var errorCode = error.code; var errorMessage = error.message; console.log(error.code) console.log(error.message) }); } function githubSignout(){ firebase.auth().signOut() .then(function() { console.log('Signout successful!') }, function(error) { console.log('Signout failed') }); }