Separation of javascript and php