共享此按钮使用jQuery功能

时间:2012-01-27 16:31:30

标签: jquery sharethis

文件:

  1. 的index.php
  2. news.php
  3. newsJavaScript.php
  4. 鉴于 [news.php] 位于 [index.php] 内的 iframe ,当我点击DIV时ID #btn_noti15 (数字是可变的),脚本是suposed 根据同一文件中的jQuery脚本转到 [newsJavaScript.php] 并添加在那里写的内容,包括 Twitter Facebook 按钮,但实际上它们没有显示。

    所以我想知道hw在发生时会显示 Twitter Facebook 按钮。

    *网站URL,名称和分享此出版商编号因安全原因而被修改。

    [的index.php]

    <div class="videos_box" id="noticias_box">
        <div class="titulo">NOTICIAS</div>
        <div class="cerrar" id="btn_cerrar3"><img src="images/btn_cerrar.png" width="20" height="20" border="0" /></div>
        <div class="videos_box2">
            <ul id="menutab3" class="menu">
                <li class="active"><a href="#general">General</a></li>
            </ul>
            <div id="general" class="content">
                <div class="noticias_box1" id="noticias_box1"><iframe src='news.php' height='100%' width='100%'></iframe></div>
            </div>
        </div>
    </div>
    

    [news.php]

    <html>
    
        <head>
            <title>Share This Buttons</title>
            <script type="text/javascript">var switchTo5x=false;</script>
            <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
            <script type="text/javascript">stLight.options({publisher:'000-000-000-000-000'});</script>
            <?php require_once 'newsJavaScript.php'; ?>
        </head>
    
        <body>
            <div id="container">
            (...)
                <div id="shareButtons">
                    <span  class='st_twitter_hcount' displayText='Tweet'></span>
                    (...)
                    <span class='st_facebook_hcount' displayText='Facebook' st_title="Noticias | Web Site" st_url="http://www.domainname.com/index.php?since=noticias&amp;idArticulo=<?php echo $idArticulo; ?>" st_image="http://www.domainname.com/uploads/noticiasPequena/noti_8.jpg"></span>
                </div>
            (...)
                <div class="noticias_box5a" id="btn_noti<?php echo $faq['contID']; ?>">
                    <img src="uploads/noticiasPequena/<?php echo $faq['file']; ?>" border="0" />
                    <p><?php echo utf8_decode($faq['titulo_txt']); ?></p><br/>
                </div>
            (...)
        </body>
    
    </html>
    

    [newsJavaScript.php]

    <script type="text/javascript">
        $(document).ready(function(){
            (...)
                $("#btn_noti<?php echo $faq['contID']; ?>").click(function() {
                    $("#foto_noti").html("<img src='uploads/images/<?php echo $faq['file']; ?>' width='600' height='299' alt='<?php echo $faq['titulo_txt']; ?>' />");
                    $("#texto_noti").html("<div class='scroll-pane' id='texto_noti'><h2><?php echo utf8_decode($faq['titulo_txt']); ?></h2><?php echo utf8_decode($faq['contenido_txtbox']); ?><div class='scroll-pane' id='texto_noti');
                    $("#shareButtons").html("<span  class='st_twitter_hcount' displayText='Tweet'></span><!-- @todo Eliminar ruta a NEW --><span class='st_facebook_hcount' displayText='Facebook' st_title='Noticias | Web Site' st_url='http://www.domainname.com/index.php?since=noticias&idArticulo=<?php echo $faq['contID']; ?>' st_image='http://www.domainname.com/uploads/noticiasPequena/noti_8.jpg'></span>");
                });
            (...)
        });
    </script>
    

    我希望能够清楚,但如果您需要更多信息,我将很乐意。

    感谢您的回答。

0 个答案:

没有答案