=========
safe_mode
=========

.. js:attribute:: safe_mode

**domain**: client 

**language**: javascript

**class** :doc:`Task </refs/client/task_api>`

Description
===========

Check the ``safe_mode`` attribute to determine if the 
:doc:`safe mode </admin/project/parameters>`
parameter of the project is set.

Example
=======

.. code-block:: js

    function on_page_loaded(task) {
    
        $("#title").html(task.item_caption);
        if (task.safe_mode) {
            $("#user-info").text(task.user_info.role_name + ' ' + task.user_info.user_name);
            $('#log-out')
            .show()
            .click(function(e) {
                e.preventDefault();
                task.logout();
            });
        }
    
        task.tasks.view($("#content"));
    } 


See also
========

:doc:`Parameters </admin/project/parameters>`

:doc:`user_info <at_user_info>`

:doc:`on_page_loaded <on_page_loaded>`
