For the javascript guru's I have a question. Setting up a .js file to populate data on various pages and I can't figure out what's missing.
javascript error - what's missing?
5
For the javascript guru's I have a question.
Setting up a .js file to populate data on various pages and I can't figure out what's missing.
Here's the code and the error message I keep getting.
--------------
function linkwrite() {
var link = newArray()
for (x in link) {
element = document.getElementById("link"+x);
url = link[x];
linkText = element.innerHTML;
element.innerHTML='<a href="+url+">'+linkText+'</a>';
}
}
--------------
Problem at line 3 character 6: Bad for in variable 'x'.
for (x in link) {
Any thoughts?
Thanks
Ernie
Setting up a .js file to populate data on various pages and I can't figure out what's missing.
Here's the code and the error message I keep getting.
--------------
function linkwrite() {
var link = newArray()
for (x in link) {
element = document.getElementById("link"+x);
url = link[x];
linkText = element.innerHTML;
element.innerHTML='<a href="+url+">'+linkText+'</a>';
}
}
--------------
Problem at line 3 character 6: Bad for in variable 'x'.
for (x in link) {
Any thoughts?
Thanks
Ernie
- phpbbxpert
- [1] reply
- johlum
- phpbbxpert
- [1] reply
- johlum
Next Topics on Trending Feed
-
5