Loading ...

Geting the login username within the Raw HTML widget | Communifire Support

Home » Spaces » Communifire Support » forum » Communifire API & Developers » Geting the login username within the Raw HTML widget
Communifire Support

Leave Space :

Are you sure you want to leave this space?

Join this space:

Join this space?

Add a new tab

Add a hyperlink to the space navigation. You can link to internal or external web pages. Enter the Tab name and Tab URL. Upload or choose an icon. Then click Save.

The name that will appear in the space navigation.
The url can point to an internal or external web page.
Login to follow, share, and participate in this space.
Don’t have a support community login?Create your account now
Posted in: Communifire API & Developers

Geting the login username within the Raw HTML widget

Subscribe to RSS
  • shaisha

    Hello,

    Is there a way to get the user name or unique login name within the Raw HTML widget? 

     

  • aparna
    Answered

    Hi Shai,

    Yes, you can use this sample code to display a user name within the Raw HTML widget:

    <div id="mycustomid"></div>
    <script>
        $(function() {
            $.ajax({
                type:'GET',
                dataType: 'json',
                url:'api/users/me',
                complete: function(response){
                    var objJSON = JSON.parse(response.responseText);
                    $('#mycustomid').html(objJSON.UserName)
                }
            });
        });
    </script>


    Hope this helps.
    Thanks,
    Aparna

  • shaisha

    Thanks Aparna!

    It's working perfect. 

Page 1 of 1 (3 items)