Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ![]() Interested in joining? Click here. If you are already a member of ZBCode, feel free to login right here: |
| Groups in ZB | |
|---|---|
| Tweet Topic Started: Jun 10 2009, 06:33 PM (593 Views) | |
| Dorith | Jun 10 2009, 10:41 PM Post #11 |
![]()
Has just entered the Matrix
![]()
|
Hmm, seems a lot longer and more complicated than I imagined it would be. |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 10 2009, 11:50 PM Post #12 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Haha yeah. Things with JavaScript tend to be like that. |
| The Resource Board | |
![]() |
|
| Dorith | Jun 11 2009, 02:39 AM Post #13 |
![]()
Has just entered the Matrix
![]()
|
Well back to basic document.write :'( cause I didn't really understand that code Edit: Instead of
If I were to switch it to something like
Would that work so that the member that can see "said" forum, could have their name added "Sponsor" at the end like there? Also would this work every time, or only when that user actually sees that forum? Did I even use the append feature correctly? Edited by Dorith, Jun 11 2009, 02:51 AM.
|
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 11 2009, 01:09 PM Post #14 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Haha no, that isn't right. Although, if you were using jQuery, it would work. Kind of. Firstly, that isn't an ID you're getting. IDs exist only once on a particular page, and a.member is a jQuery selector (or a CSS selector, either one of the two.) .member signifies a class of 'member.' For some reason, the creators of JS decided to be difficult and not include a getElementsByClass or anything similar. So you're stuck looping through every <a> tag on the page manually, like so... I wrote out a little description in comments for you. Again, I highly recommend getting Notepad++ so you can see the difference between the comments and the actual javascript going on there. |
| The Resource Board | |
![]() |
|
| Dorith | Jun 11 2009, 03:30 PM Post #15 |
![]()
Has just entered the Matrix
![]()
|
So let's supposed this code:
Would .innerHTML be website or www.com? And how would I reference the difference between those to? I'm thinkin of creating this one code, but I don't want you to know what it is yet, cause you'll probably end up writing it up. And I REALLY wanna figure this out ![]() |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 11 2009, 06:46 PM Post #16 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Well you've got to have some way to find that element, but the innerHTML will be "website" and if you want to get the href, you just do (without the quotes) If you have Firebug (and if you don't, I suggest you get it ) then you can type this into the console to see what I mean. It'll give you two alerts. I created your imaginary element in the first 3 lines, as well. edit: typo Edited by Reid, Jun 11 2009, 06:46 PM.
|
| The Resource Board | |
![]() |
|
| Reid | Jun 11 2009, 06:52 PM Post #17 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
GahhhhhH! Six hundred and sixty six posts! /destroy |
| The Resource Board | |
![]() |
|
| Dorith | Jun 11 2009, 07:06 PM Post #18 |
![]()
Has just entered the Matrix
![]()
|
So I made these:
Not sure how to execute that last one. Tell me what I did wrong (cause I'm sure something is wrong), and stuff... |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 11 2009, 08:05 PM Post #19 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Woah. So... You want to find the name 'Grey' and replace it with 'Grey Sponsor'? Let's take this one step at a time then. Your way doesn't work because... you have to loop through the links somehow. Like.. this 'var' stands for variable. So is an example. You don't ever have to use the var keyword either - although you are supposed to when you first define a variable. |
| The Resource Board | |
![]() |
|
| Dorith | Jun 11 2009, 08:59 PM Post #20 |
![]()
Has just entered the Matrix
![]()
|
OH SNAP! I almost got it! I actually sorta set that up, except in like 2 different codes. Hmm, now I'm gonna try and code it to be more efficient. And maybe code it another way by adding it to the beginning or end of that found person.I'm sorta getting this now though I don't get this part completely:
You said something about it before, but do it noob talk. Like why name[findname]? And what are those "--" for? Also what is "!-=1"? Cause I see it a lot in your guys' codes. |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Code University · Next Topic » |



















OH SNAP! I almost got it! I actually sorta set that up, except in like 2 different codes.
Hmm, now I'm gonna try and code it to be more efficient. And maybe code it another way by adding it to the beginning or end of that found person.
7:46 PM Jul 10