JS Problems, again. |
JS Problems, again. |
locoforcoco9 |
Apr 30 2012, 07:18 PM
Post
#1
|
Group: Members Posts: 6 Joined: 18-January 11 Member No.: 13,624 |
My website for my class uses a little TextArea (with id="coder") that has a button that SHOULD send the info to a function, which will read that. It reads it and does 99.9% of what it should, but on FireFox it breaks completely at this point:
CODE for (i=1;1<len;i++) { if (lines[i].indexOf(":") !== -1) {styles = lines[i].split(":"); } if (lines[i].indexOf(": ") !== -1) {styles = lines[i].split(": "); } document.getElementById("coder").style[styles[0]] = styles[1]; //---THIS } It breaks at the 4th line shown. It says that document.getElementById("coder") is null, even though to get to that point it uses that exact text to check what the first line is. NOTE: This is supposed to allow the user to change the style of it by typing in "#style" (w/o quotes) on the first line, and the next line(s) should contain a format of PROPERTY: DESCRIPTORS. Example: CODE #style border: 2px solid red position: absolute top: 100 left: 100 Would act as if it had a CSS style doing the same things. |
locoforcoco9 |
Apr 30 2012, 07:33 PM
Post
#2
|
Group: Members Posts: 6 Joined: 18-January 11 Member No.: 13,624 |
Oi, nevermind. I realized the problem; it isn't with the shown code. Sorry.
|
Lo-Fi Version | Time is now: 26th April 2024 - 08:59 AM |