View Full Version : php javascript continuous loading

mint suite
06-22-2006, 06:56 PM
I've built a page that creates an array from php using javascript (this will eventually go into a slideshow script).

The array displays on the page but the page continues to load - the hourglass doesn't go away.

Do I need to put a stop somewhere?

Here's the page:


// Performing SQL query
$query = 'SELECT * FROM photographers ORDER BY photo_id LIMIT 10 ';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

//var for hold data javascript array
$javascriptarray= " <script language=\"javascript\">phpjavasarr = new Array();"."\n";

//we need counter
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {

/*$col_value=htmlentities("<a href='http://www.google.com'>".$line[first_name]."</a>"]);*/
$javascriptarray.= "phpjavasarr[$iC]=\"$col_value\";"."\n";

//end of javscript and simple example show quote
function showquote() {
var x=0;
for (x=0; x<$iC; x++)

//print it
echo $javascriptarray;

<body >

<a href="javascript:showquote()">show names</a>

06-22-2006, 07:13 PM
it's the document.write

try ending with document.close()