|
Post by Nightwalker on Nov 18, 2010 22:16:11 GMT
ok that helps a lot...
|
|
|
Post by Nightwalker on Nov 18, 2010 23:18:13 GMT
|
|
|
Post by moneyman18 on Nov 19, 2010 1:56:05 GMT
It checks to see if the welcome table matches 'Welcome Guest' to ensure that the user is a guest. Though it would be easier checking pb_username but idk if that was there in 2005. If the user is a guest it then loops through all the tables and checks that the inner html matches 'Info Center' and has a width of 100%. If matches both those things it sets the table display to none.
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Nov 19, 2010 2:51:20 GMT
It would be better to use (if you don't know this): if(pb_username=='Guest'){ what ever........... }
|
|
|
Post by Nightwalker on Nov 19, 2010 3:26:55 GMT
yea i know the username one...
|
|
xcessive
Epic Poster
.[M:5000]
Posts: 526
|
Post by xcessive on Nov 20, 2010 1:09:45 GMT
Hold on, doesn't JS use the default array architecture with [0] being the first element?
I know java does, but its been ages since I used JS.
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Nov 20, 2010 1:25:16 GMT
Yes it does........ why?
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Dec 10, 2010 21:14:43 GMT
Anyone find this useful? Might continue it.
|
|
Jordan
Elite Poster
[M:5000]
Posts: 286
|
Post by Jordan on Dec 12, 2010 2:00:51 GMT
If you wanted the 5th on it would be document.getElementsByTagName("TD")[ 5]; Arrays start counting at 0 so the 5th element in the array would actually be the 6th td element on the page. Just in case people are wondering, and I sent this to you in a pm the other day Luke, arrays start at zero for one main reason, but there's also another which makes it more beneficial. The first is that the number in the subscript operator of the array is an offset from the arrays location in memory. If you have an array called myArray, then the address of that array in memory is stored in that variable. So say we allocate a char array of 5 elements which is five bytes. In memory, the first char is going to be 0 bytes away from the address at myArray because what myArray[0] really means is myArray + 0 or arrayAddress + 0 bytes. The next element would be at myAddress + 1 byte. So the name of the array is actually an address which points to the first item in the array (in Javascript it may not be exactly this way, but this is how it was in older languages such as C and so subsequent languages I assume just adopted this. There's also the fact that many later languages such as Java make everything an object so they address would actually be stored in a private member most likely). The second reason is so you can use the modulus operator on the array which is extremely useful if you are using your array as a circular container meaning once you go past the last element in the array you loop back to the first element. The is useful in data structures such as hash tables and circular queues. Just google the modulus operator if you want to get an idea of what I'm talking about.
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Dec 12, 2010 2:02:15 GMT
Woops, that was a mis type! D:
Thanks for pointing it out though.
|
|
|
Post by Oompa Loompa doompadee doo on Jul 27, 2011 2:17:50 GMT
Wow coding is complicated.
|
|
|
Post by (/iPokemon/) on Jul 28, 2011 4:42:03 GMT
You don't have to use single quotes when declaring a variable value..
|
|
Cam
Administrator
[M:5000]
Posts: 6,381
|
Post by Cam on Jul 28, 2011 5:06:11 GMT
Wow this is old.....
|
|
|
Post by (/iPokemon/) on Jul 28, 2011 6:05:34 GMT
It was at the top, so I felt like replying to it
|
|