javascript - Make my Zopim chat script to open in new window - Stack Overflow

Below is my chat script for my website. It always open at bottom right of my web page. I want to make i

Below is my chat script for my website. It always open at bottom right of my web page. I want to make it open in new separate window.

function chat()
{
    window.$zopim||(function(d,s){
        var z = $zopim = function(c){
                z._.push(c)
            },
            $ = z.s = d.createElement(s),
            e = d.getElementsByTagName(s)[0];
        z.set = function(o){
            z.set._.push(o)
        };
        z._ = [];
        z.set._ = [];
        $.async = !0;
        $.setAttribute('charset','utf-8');
        $.src = '//v2.zopim/?1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe';
        z.t =+ new Date;
        $.type = 'text/javascript';
        e.parentNode.insertBefore($,e)
    })(document,'script');
}

I'm new to scripting, can any one help me?

Below is my chat script for my website. It always open at bottom right of my web page. I want to make it open in new separate window.

function chat()
{
    window.$zopim||(function(d,s){
        var z = $zopim = function(c){
                z._.push(c)
            },
            $ = z.s = d.createElement(s),
            e = d.getElementsByTagName(s)[0];
        z.set = function(o){
            z.set._.push(o)
        };
        z._ = [];
        z.set._ = [];
        $.async = !0;
        $.setAttribute('charset','utf-8');
        $.src = '//v2.zopim./?1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe';
        z.t =+ new Date;
        $.type = 'text/javascript';
        e.parentNode.insertBefore($,e)
    })(document,'script');
}

I'm new to scripting, can any one help me?

Share Improve this question edited Feb 6, 2014 at 3:27 Shankar Prakash G asked Dec 19, 2013 at 5:52 Shankar Prakash GShankar Prakash G 1,12918 silver badges36 bronze badges 1
  • That's a third party plugin, you should contact Zopim support for this.. – Mr. Alien Commented Dec 19, 2013 at 5:54
Add a ment  | 

2 Answers 2

Reset to default 3

Finally I found almost perfect one.

<a href="#" onclick="openWin()" >Live Chat Online</a>

<script>
function openWin()
{
var myWindow = window.open("https://v2.zopim./widget/popout.html?key=1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe","","width=500,height=500");
}
</script>

Replace your key=1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe, you can get it from the zopim generated code at this line

$.src = '//v2.zopim./?1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe';

Try this

<a href="javascript:void($zopim.livechat.window.openPopout())">Open chat in new window</a>

DEMO

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744886252a4599135.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信