Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Silent

Silent Avatar

***
Dedicated Member

155


September 2009
Can someone tell me the IDs of ProBoard Tables.

Like the ID to show how much post there are in a table. Or topics.

Description, On/Off, stuff like that.

If this isn't the right section then sorry.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Coders' hangout would be better, so I'll move this there. :)

Anyways, there aren't any IDs... you need to loop through things to find items. (Annoying, I know.) If you want help with that I can try to explain the process?

Silent

Silent Avatar

***
Dedicated Member

155


September 2009
Please, explain. Thank you.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Silent Avatar
Please, explain. Thank you.


As far as PB coding in JavaScript is concerned, everything is done by looping through a list of the cells or tables... most people prefer cells. I actually did a quick search and found three tuts on SZ that cover this decently:

forum.sz-ex.com/index.cgi?action=display&board=codetuts&thread=2065
forum.sz-ex.com/index.cgi?action=display&board=codetuts&thread=9776
forum.sz-ex.com/index.cgi?action=display&board=codetuts&thread=9917

There's a few things they don't really mention that I'll point out. Basically, we do loops because we don't know where in the page the cell we want is AND there are usually multiple of that cell. For example, the on/off columns. Not only do we not know if they're at location 25 or 32, but we need to do multiple since there's typically more than one on/off column, thus a loop is most effective.

Another thing is basically HOW to match the cell. In those tutorials, I kinda noticed we just -assumed- you'd figure it out. (We're asses, aren't we? :P) Basically, you're matching properties of the cell. We're checking if cell td has a width of 22%, because that's a property of the cell we want. Typically you'll need to match more than one property because there's multiple cells that have said property.

Hopefully those tuts plus this info help. >.<


Silent

Silent Avatar

***
Dedicated Member

155


September 2009
Thank you for the info. Only thing that bugs me is how do you use Inner.HTML?

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Silent Avatar
Thank you for the info. Only thing that bugs me is how do you use Inner.HTML?


innerHTML let's you literally update the internal HTML of an object; the HTML inside the cell if you're using a cell. Stuff like that.

First, you need the element you want to update. For example, aTD would be the element in my coding. We could then do this:

aTD
.innerHTML = "<b>New Bolded Text</b>";

And thus the cell aTD
would have New Bolded Text shown as the only content inside it.

Silent

Silent Avatar

***
Dedicated Member

155


September 2009
That is great. But how do we find an element of something? Well, for Proboards.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Silent Avatar
That is great. But how do we find an element of something? Well, for Proboards.


An element? Do you mean a property of an HTML element or an actual HTML element?

If you mean a property, you'll need to view the source code to find the cell you want and then read the HTML.

If you mean an actual element, you'll need to do the same thing as above, but with looping.

Silent

Silent Avatar

***
Dedicated Member

155


September 2009
Well, I didn't know any of that. Till now. Thank you.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
No problem. :) If you have any more questions or hold ups, feel free to ask.

newBookmarkLockedFalling