Scusate per il ritardo nella risposta...
Si certo, posto il codice, ma non credo sia un problema di keyword:
Codice PHP:
//------- Questo è il contesto html degli script, per inciso, HTML 4.01 strict
<html>
<head>
<link rel="StyleSheet" type="text/css" href="src/titles.css">
<script type="text/javascript" src="src/fs.js"></script>
<script type="text/javascript" src="src/Initialize.js"></script>
</head>
<body>
<!--
Corpo del body
-->
<script type="text/javascript" src="src/Second.js"></script>
</body>
</html>
//-------------------Questo è il file initialize.js
var x=10;
var y=10;
var StartX=50;
var StartY=300;
//Creazione dinamica di una matrice x per y
var matrice = new Array(x);
for (i=0;i<10;i++)
matrice[i]=new Array(y);
//Inizializzazione della matrice
for (i=0;i<x;i++)
for (j=0;j<y;j++)
matrice[i][j]=10;
//------------------ Questo è il file second.js
document.getElementById("nome").select();//Imposto il focus su un form field
DrawImages();
function DrawImages()
{
var elem;
for (i=0;i<x;i++)
for (j=0;j<y;j++)
{
elem=document.getElementById("ImageAtX"+i+"y"+j);
if (!elem) //Verifico se esiste già un elemento con questo id
{
CreateDiv("MapLocationX"+i+"Y"+j, "", StartX+i*50, StartY+j*50, 50, 50);
elem=document.getElementById("ImageAtX"+i+"y"+j);
}
//Fa qualcosa per ricavare nomeimmagine da inserire in base ai dati contenuti nella matrice[][]
elem.innerHTML="[img]images/"+nomeimmagine+".gif[/img]";
}
}
//------------------- CreateDiv() sta nel file fs.js:
function CreateDiv(id, content, x, y, w, h)
{
//x e y sono le posizioni assolute del futuro div, mentre w e h sono width e height
x+="";
y+="";
w+="";
h+="";
if (x.charCodeAt(x.length-1)<58 && x.charCodeAt(x.length-1)>47) x+="px";
if (y.charCodeAt(y.length-1)<58 && y.charCodeAt(y.length-1)>47) y+="px";
if (w.charCodeAt(w.length-1)<58 && w.charCodeAt(w.length-1)>47) w+="px";
if (h.charCodeAt(h.length-1)<58 && h.charCodeAt(h.length-1)>47) h+="px";
var dv = document.createElement('div');
dv.setAttribute('id', id);
dv.setAttribute('name', id);
document.body.appendChild(dv);
if (w) dv.style.width = w;
else dv.style.width = "50px";
if (h) dv.style.height = h;
else dv.style.height = "50px";
dv.style.position = "absolute";
if (x) dv.style.left = x;
else dv.style.left = 0;
if (y) dv.style.top = y;
else dv.style.top = 0;
dv.style.background = "#000";
dv.style.border = "0px";
dv.innerHTML = content;
}
Scusate le variabili in inglese... sapete, a forza di leggere libri e guide in inglese, io li commento anche i programmi in quella lingua!!!