从映像启动聊天程序脚本

时间:2015-09-23 15:57:05

标签: javascript jquery html

我正在尝试通过点击我们网站上的图片,从第三方发布给我们的脚本。

提供代码的公司并不是很有帮助。我希望有人可以帮助我。

这是聊天程序代码:

<!-- Embedded ClickAndChat.com: Insert the script below at the point on your page where you want the Click To Chat link to appear -->

<script type='text/javascript' src="http://server2gateway.clickandchat.com/include.js?domain=www.palmbeachschools.org_ace_studentzone"></script>

<script type='text/javascript'>
if(typeof sWOTrackPage=='function')sWOTrackPage();
</script>

<!-- End of embedded ClickAndChat.com --> 

,这是图像/按钮的Html

<a href="#">
    <img src="http://www.palmbeachschools.org/ace/images/SZ-Counselor-Main.png" width="390" height="130" alt="" onclick="()" />
</a>

1 个答案:

答案 0 :(得分:0)

以下是单击Google图片时将加载lodash lib的页面示例。您应该只需将脚本URL和图像src更改为您想要的内容。

<html>
<head>
</head>
<body>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script>
    $( document ).ready(function() {
        console.log( "ready!" );
        console.log("lodash not loaded " + typeof _)

    });

   function loadScript() {
       if (typeof someObject == 'undefined') {
           $.getScript('https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js', function(){
               //Stuff to do after someScript has loaded
                console.log("lodash loaded : " + _.VERSION);
           });
       }
   }

    </script>

   <img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" onClick="loadScript();"></img>
</body>
</html>