-
-
Save nicholasess/b1e59c4c4ab3bef5c56f to your computer and use it in GitHub Desktop.
ajax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Home</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
</head> | |
<body nick-app> | |
<div nick-view></div> | |
<script> | |
var nick = { | |
app: document.querySelectorAll('[nick-app]'), | |
view: document.querySelectorAll('[nick-view]'), | |
init: function(){ | |
}, | |
loadView: function(object){ | |
var oReq = new XMLHttpRequest(); | |
oReq.addEventListener("load", function(){ | |
console.log(this.responseText); | |
}, false); | |
oReq.open("get", object['view'], true); | |
oReq.send(); | |
} | |
} | |
nick.init(); | |
nick.loadView({ | |
view: 'home.html' | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment