ファイル:
- index.php
- ニュース.php
- newsJavaScript.php
[news.php]が[index.php]内のiframeにあることを考えると、ID #btn_noti15 (数字は可変) の DIV をクリックすると、スクリプトは[newsJavaScript.php]に移動することになっています。同じファイルにある jQuery スクリプトを使用して、TwitterやFacebookの ボタンなど、そこに記述されたコンテンツを追加しますが、実際には表示されません。
それで、 TwitterとFacebookのボタンが発生したときにどのように表示するかを知りたいです。
*Web サイトの 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>
[ニュース.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>
[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>
明確にしたいと思っていますが、さらに情報が必要な場合は、喜んでお答えします.
回答ありがとうございます。