PHP Classes
elePHPant
Icontem

File: examples/material-design/js/app.js

Recommend this page to a friend!
  Classes of Subin Siby  >  Secure PHP Login System  >  examples/material-design/js/app.js  >  Download  
File: examples/material-design/js/app.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Secure PHP Login System
Register and login users using a database via PDO
Author: By
Last change:
Date: 2 years ago
Size: 800 bytes
 

 

Contents

Class file image Download
var base = '/examples/material-design/';
var pages = [
    'index.php',
    'login.php',
    'register.php',
    'home.php',
    'manage-devices.php',
    'change.php',
    'reset.php',
    'profile.php'
];

$.each(pages, function(i, page) {
    $.router.add(base + page, function() {
        $.get(base + page, function(html) {
            var htmlObj = $(html);

            $('title').replaceWith(htmlObj.filter('title'));
            $('.container').replaceWith(htmlObj.filter('.container'));

            window.history.replaceState({}, '', htmlObj.filter('meta[name=page-path]').attr('content'));
        });
    });
});

$(document).ready(function() {
    $(document).on('click', 'a[data-ajax]', function(e) {
        e.preventDefault();
        $.router.go($(this).attr('href'));
    });
});