• I want to use the current_user value in javascript on wordpress page.
    Current_user is required to use the IFRAME Tags.
    How can I get this value?

    ex) Source Code on My Page
    <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js&#8221; type=”text/javascript”></script>
    <script type=”text/javascript”>// <![CDATA[
    $(document).ready(function(){
    var encode_userid= window.btoa(‘[current_user’);
    document.getElementById(“comeFrame”).src=”https://URL/user/loginSSO.crd?login_arg=&#8221; + encode_userid + “&page=list”;

    });
    // ]]></script>
    <iframe id=”comeFrame” style=”z-index: 0;” src=”” width=”690″ height=”810″ frameborder=”0″ scrolling=”no”></iframe>

Viewing 1 replies (of 1 total)
  • Hi,

    Have a look at this article.
    It should help you – basically you need to pass a variable to javascript from within php.

Viewing 1 replies (of 1 total)
  • The topic ‘How to get current_user in Javascript?’ is closed to new replies.