How i can get user email id or other information in javascript without adding user profile block in admin account. Is there any way to do this.
Get user information in javascript file without adding user profile block
by yasha jain -
Number of replies: 3
In reply to yasha jain
Re: Get user information in javascript file without adding user profile block
by Davo Smith -
When you initialise your javascript, pass the relevant details into it.
e.g. if you are using the recommended AMD module method of loading javascript:
$PAGE->requires->js_call_amd('plugin/jsmodule', 'init_function', array($userdetails));
In reply to Davo Smith
Re: Get user information in javascript file without adding user profile block
by yasha jain -
In reply to yasha jain
Re: Get user information in javascript file without adding user profile block
by Davo Smith -
I'm not aware of any way to pass information into the JavaScript when adding it that way. I suggest that if your requirements involve needing access to extra data, then you should look at writing a full plugin.