dwoo template variables inside JavaScript?

Posted by user344711 on Stack Overflow See other posts from Stack Overflow or by user344711
Published on 2010-05-19T04:07:45Z Indexed on 2010/05/19 4:10 UTC
Read the original article Hit count: 183

Filed under:
|
|
|
|

Hi everyone!

i have this code.

{if $loginUrl}
{literal}
<script type="text/javascript">
    var newwindow;
    var intId;
    function login() {
        var  screenX    = typeof window.screenX != 'undefined' ? window.screenX : window.screenLeft,
             screenY    = typeof window.screenY != 'undefined' ? window.screenY : window.screenTop,
             outerWidth = typeof window.outerWidth != 'undefined' ? window.outerWidth : document.body.clientWidth,
             outerHeight = typeof window.outerHeight != 'undefined' ? window.outerHeight : (document.body.clientHeight - 22),
             width    = 500,
             height   = 270,
             left     = parseInt(screenX + ((outerWidth - width) / 2), 10),
             top      = parseInt(screenY + ((outerHeight - height) / 2.5), 10),
             features = (
                'width=' + width +
                ',height=' + height +
                ',left=' + left +
                ',top=' + top
              );

        newwindow=window.open('{$loginUrl}','Login by facebook',features);

        if (window.focus) {newwindow.focus()}
        return false;
    }
</script>
{/literal}
{/if}

It is dwoo templates, i wonder how can i use my dwoo variables inside javascript? im trying to do it just at you can see at the code, but it doesnt work. I need to warp my code between {literal} so it can work.

© Stack Overflow or respective owner

Related posts about dwoo

Related posts about php