javascript error - what's missing?
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 -
Thanks - 1 reply
{{ DiscussionBoard.errors[3036672].message }}-
johlum -
Thanks
{{ DiscussionBoard.errors[3036706].message }} -
-
-
phpbbxpert -
Thanks - 1 reply
{{ DiscussionBoard.errors[3036736].message }}-
johlum -
Thanks
{{ DiscussionBoard.errors[3036749].message }} -
-