1
0
mirror of https://github.com/k4m4/movies-for-hackers.git synced 2024-11-23 14:34:55 +00:00

More solid ajax get

This commit is contained in:
MichaelCook 2017-02-23 14:51:00 +00:00
parent cdaa5ce9bc
commit 54824436b3

View File

@ -38,7 +38,7 @@ objectifyMarkdownNotWomen.table = function(header, body) {
movies = [{}]; movies = [{}];
}; };
client.open('GET', '../../README.md'); client.open('GET', baseUrl() + '/README.md');
client.onreadystatechange = function(e) { client.onreadystatechange = function(e) {
// Whipe movies and collections as this'll run a bunch of times // Whipe movies and collections as this'll run a bunch of times
moviesCollection = []; moviesCollection = [];
@ -56,3 +56,8 @@ client.onreadystatechange = function(e) {
}); });
}; };
client.send(); client.send();
function baseUrl() {
var href = window.location.href.split('/');
return href[0]+'//'+href[2]+'/';
}