Quote:
Originally Posted by Old Pedant
Which code isn't working in FF? Exactly what is in your post #11 or something different?
|
I'll get you the code. Firefox is reloading the page. You can see it here:
http://www.QuizBonanza.com/campaigns/iframe.php
Code:
<iframe id="myframe" width=100% height=1000px></iframe>
<form name="this_form" method="POST" action="">
<input type="submit" name="submit4" value="Submit" onclick="loadNextPage(1)"></button>
</form>
<?
$link = mysql_connect('localhost', 'ad20_ad20', 'xxxxxxxx');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db('xxxxxxx', $link);
if (!$db_selected) {
die ('Can\'t use foo : ' . mysql_error());
}
?>
<script type="text/javascript">
var cnt=0,webpageArray = [<?php
$query = "SELECT URL FROM path where campaigns LIKE '%$currentFile%'";
$result = mysql_query($query) or die( mysql_error() );
$delimiter = "";
while ( $row = mysql_fetch_array($result) )
{
echo $delimiter . '"' . $row[0]. 'UNIQUEID' . '"' ;
$delimiter = ",\n";
}
?>];
var countDown;
function doCountDown( )
{
var btn = document.this_form.submit4;
if ( countDown <= 0 )
{
btn.value = "Submit";
btn.disabled = false;
return;
}
btn.value = "Submit... " + countDown;
btn.disabled = true;
--countDown;
setTimeout( doCountDown, 1000 );
}
function loadNextPage(dir) {
cnt += dir;
// this can never happen: if (cnt<0) cnt=webpageArray.length-1; // wrap
if (cnt>= webpageArray.length) {
return;
}
var iframe = document.getElementById("myframe");
iframe.src = webpageArray[cnt];
countDown = 10;
doCountDown( );
$('html, body').animate({ scrollTop: 0 }, 'fast');
}
loadNextPage(0); // actually loads first page
</script>