Last active
August 29, 2015 14:04
-
-
Save nfreader/70df7e06ae1667481e17 to your computer and use it in GitHub Desktop.
This file contains 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
function loadContent(page, content, dest) { | |
$(dest).load("view/" + page + ".php " + content + ""); | |
console.log("view/" + page + ".php " + content + " " + dest); | |
} | |
function loadPage(page) { | |
$('#game').load("view/" + page + ".php"); | |
console.log("view/" + page + ".php"); | |
} | |
$('body').delegate('.load', 'click', function() { | |
event.preventDefault(); | |
var page = $(this).attr('page'); | |
if (page == undefined) { | |
var page = $(this).attr('href'); | |
} | |
var content = $(this).attr('content'); | |
var dest = $(this).attr('dest'); | |
//$('#game').load("view/" + content + ".php"); | |
if (content == undefined && dest == undefined) { | |
loadPage(page); | |
} else { | |
loadContent(page, content, dest); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment