私は現在、次のようなJavascriptを持っています。
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
function changeSource(newSource) {
document.getElementById('preview').src = newSource;
}
});
</script>
次に、次のようなHTMLがあります。
<table border=0 class="colors">
<tbody>
<tr>
<td><a onclick="changeSource('http://www.test.com')"><img width="40" src="test.png"/></a></td>
</tr>
</tbody>
</table>
次に、Iframeセクション:
<table border=0>
<tbody>
<tr>
<td><iframe id="preview" width="125" height="303" src="test.php" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" hspace="0" vspace="0"></iframe></td>
</tr>
</tbody>
</table>
ただし、タグ内の画像をクリックしても、Iframeのソースは変更されません。なんでこんな感じ?