文件:
- 索引.php
- 新闻.php
- 新闻JavaScript.php
鉴于[news.php]位于[index.php]内的iframe中,当我单击 ID 为#btn_noti15的 DIV (数字可变)时,脚本应该根据[newsJavaScript.php]转到在同一个文件中的 jQuery 脚本并添加在那里编写的内容,包括Twitter和Facebook 按钮,但实际上它们没有显示。
所以我想知道当它发生时如何显示Twitter和Facebook按钮。
*网站 URL、名称和共享此发布者编号已出于安全原因进行了修改。
[索引.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>
[新闻.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&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>
[新闻JavaScript.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>
我希望清楚,但如果您需要更多信息,我很乐意。
感谢您的回答。