[thelist] javascript help please

Brent Clark bclark at eccotours.dyndns.org
Tue May 10 04:55:49 CDT 2005

Hi all

My deepest apologies for posting here, but im so stuck with Javascript
at the moment.

I have a index.html  file when on loading executes a javascript function
(random_mainpage() ). which reads the array (sarray) and displays in
content on the browser.

I to have a link that onclicking must execute (pframe(number)) with the
argument of the number, which in the element of the sarray.

The problem is that onclicking the link the pframe() executes but does
not display the content in the same place as where the random_mainpage()
displays its content. Also the problem is the images that must be 
displayed, dont get displayed (think its  a cache issuse, can this be 
forces to be displayed.)

Im sure that since this thread had nothing to do with this mailing list
that most others would appreciate that it be taken of the list, taken in
a of the list manner.

If anyone would be so kind as to help, it would be greatly be appreciated.

Kind Regards
Brent Clark

P.s. if someone wants to see a demo of what im trying to do, please 
contact me off the list.

My array
var sarray = new Array();
sarray[1]  = new Array();
sarray[21] = new Array();

sarray[1][0]  = '<table cellspacing="0" cellpadding="0" border="0"
sarray[1][1]  = '<tr><td class="bold_eight" bgcolor="#e9e9e9"
  >&nbsp;&nbsp;Cape Town</td></tr>';
sarray[1][23] = '</tr>';
sarray[1][24] = '</table>';

My javascript function
function pframe(numb){
	var MyMap = "/images/index/map_"+numb+".gif";
	misc = "";
	for(a = 0; a < sarray[numb].length; a++){
		misc += (sarray[numb][a]);
	document.getElementById('mainpage').innerHTML = "";
	document.getElementById('mainpage').innerHTML = misc;
	misc = "";
	MyMap = "";

function random_mainpage(element){
	var num = Math.floor( (Math.random() * sarray.length));
	if(num < 0){
		num + 1;
	var MyMap = "/images/index/map_"+num+".gif";
	for(a = 0; a < sarray[num].length; a++){

My html code

<div id="mainpage">
	<script language="javascript">

More information about the thelist mailing list