Infinite loop cause $.ajax are not loading the correct .html because i have a custom router
i have simple custom js router. (index.php and app.js) when i load /search, it works fine. but when i load /search/query, im getting an infinite loop. Im not sure on how to explain this. But here is the code.
Here is the function w(), it just split what type in the url bar. /search will return array("search"), and /search/whatever will return array('search','whatever') and so on.
function w() {
var path = window.location.pathname.split('/');
path.shift(); // Remove empty string at the...