An error occurred while loading the file. Please try again.
account.js 1.15 KiB
/*
TODO:
    Show list of registered services?
*/
// Profile Initialization
$.get( "/api/v1/profile", function(data) {
    var title = data.title
    var firstname = data.firstname
    var lastname = data.lastname
    var email = data.email
    var industry = data.industry
    var organisation = data.organisation
    var speciality = data.speciality
    // asign to HTML
    $("#fullname").text(firstname+' '+lastname);
    //document.getElementById('inputFirstname').value = firstname; //JS
    $("#inputTitle").val(title); // jQuery
    $("#inputFirstname").val(firstname);
    $("#inputLastname").val(lastname);
    $("#inputEmail").val(email);
    $("#inputIndustry").val(industry);
    $("#inputOrganisation").val(organisation);
    $("#inputSpeciality").val(speciality);
    // check for valid email and then change header accordingly:
    if(email != ''){
        document.getElementById("navbarDropdown4").innerHTML="Logout";
        document.getElementById("navbarDropdown4").href="/account/logout";
.done(function() {
    console.log("done");
.fail(function() {
    console.log( "error" );
/*.always(function() {
    alert( "finished" );
}) */