プロが教えるわが家の防犯対策術!

表示したいホームページが5つありますが、同時呼び出しは無理でした。
そこで、javascriptを使って、0.3秒or1秒置きに呼び出したいのですが、
javascriptは全く分からないためどなたか、教えていただけないでしょうか?
---現在のhtml----
<iframe src="sample/iframe_q.php?q=1" width="200" height="150">
<iframe src="sample/iframe_q.php?q=2" width="200" height="150">
<iframe src="sample/iframe_q.php?q=3" width="200" height="150">
<iframe src="sample/iframe_q.php?q=4" width="200" height="150">
<iframe src="sample/iframe_q.php?q=5" width="200" height="150">
---------------

0.3秒したら、1つ目の<iframe>を実行して、表示する。
更に、0.3秒したら、1つ目の<iframe>を実行して、表示する。
更に、0.3秒したら、2つ目の<iframe>を実行して、表示する。
更に、0.3秒したら、3つ目の<iframe>を実行して、表示する。
更に、0.3秒したら、4つ目の<iframe>を実行して、表示する。
更に、0.3秒したら、5つ目の<iframe>を実行して、表示する。

という具合です。

何卒、宜しくお願い致します。

A 回答 (4件)

たびたびすみません。

ごみが残っていました。
<HTML>
<HEAD>
<TITLE>サンプル1</TITLE>
<SCRIPT Language="JavaScript">
<!--//

function ifsub1(pa0){
var pa1;
var para1;
para1 ="sample/iframe_q.php?q=" + pa0;
pa1 = "if"+pa0;
document.frames[pa1].document.location.href=para1;

}
function test() {
var ts;
ts=300; //単位:ミリ秒

setTimeout("ifsub1('1')", ts);
setTimeout("ifsub1('2')", ts);
setTimeout("ifsub1('3')", ts);
setTimeout("ifsub1('4')", ts);
setTimeout("ifsub1('5')", ts);
}
// -->
</SCRIPT>
</HEAD>

<BODY onLoad = "test()">
<form name = "fm1">
<iframe name ="if1" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if2" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if3" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if4" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if5" src="sample/if_dummy.html" width="200" height="150">
</form>

</BODY>
</HTML>
    • good
    • 0
この回答へのお礼

たびたび、回答いただき本当に、ありがとうございました。ばっちり動作いたしました!!

お礼日時:2006/06/23 23:19

#1です。


デバッグしてみました。
<HTML>
<HEAD>
<TITLE>サンプル1</TITLE>
<SCRIPT Language="JavaScript">
<!--//

function ifsub1(pa0){
var pa1;
var para1;
para1 ="sample/iframe_q.php?q=" + pa0;
pa1 = "if"+pa0;
document.frames[pa1].document.location.href=para1;

}
function test() {
var ts;
ts=300; //単位:ミリ秒

setTimeout("ifsub1('1')", ts);
setTimeout("ifsub1('2')", ts);
setTimeout("ifsub1('3')", ts);
setTimeout("ifsub1('4')", ts);
setTimeout("ifsub1('5')", ts);
}
// -->
</SCRIPT>
</HEAD>

<BODY onLoad = "test()">
<form name = "fm1">
<iframe name ="if1" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if2" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if3" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if4" src="sample/if_dummy.html" width="200" height="150">
<iframe name ="if5" src="sample/if_dummy.html" width="200" height="150">
</form>
<SCRIPT Language="JavaScript">
<!--//
test();
// -->
</SCRIPT>

</BODY>
</HTML>
    • good
    • 0

負荷テストを実施したいのでしょうか?


だとしたらフリーソフトでJMeterというのがあります。

簡単に操作できますので
使用してみてはどうでしょうか?

参考URL:http://www.stackasterisk.jp/tech/engineer/jmeter …
    • good
    • 0

<html>


<head>
<title>テスト</title>
<script type="text/javascript">
<!--
function ifsub(pa0) {
var pa0;
var para1;
para1 = ="sample/iframe_q.php?q=" & pa0;
document.fm1.parent.ifselect.location.href=para1;

}
function func() {
var ts;
ts=300
setTimeout("ifsub('1')", ts);
setTimeout("ifsub('2')", ts);
setTimeout("ifsub('3')", ts);
setTimeout("ifsub('4')", ts);
setTimeout("ifsub('5')", ts);
}
// -->
</script>
</head>
<body onload="func()">
<form name="fm1">
<iframe name="if1" src="sample/if_dummy.html" width="200" height="150">
<iframe name="if2" src="sample/if_dummy.html" width="200" height="150">
<iframe name="if3" src="sample/if_dummy.html" width="200" height="150">
<iframe name="if4" src="sample/if_dummy.html" width="200" height="150">
<iframe name="if5" src="sample/if_dummy.html" width="200" height="150">
</form>
</body>
</html>
未確認ですが、考え方は間違っていないと思います。
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!