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: |
| Using Javascript? | |
|---|---|
| Tweet Topic Started: Jun 12 2009, 01:01 PM (301 Views) | |
| Lout | Jun 12 2009, 01:01 PM Post #1 |
![]() ![]()
|
Hi guys, I want to use this code:-
But with a slight difference, it's posted here, but on the last post it has been slightly changed to this:-
Which works well in testing. However, it will require lots of additional lines to be added to the board template in this format :- Add("Username" , "Image URL" , "Award Reason"); For each and every award. So instead I've come up with this:- ![]() Which will allow me to just paste up to 6 awards in the boxes and then only need one line of code for each user, which I would substitute with each additional award that they earn. I've already worked out that by removing the Award Reason (but still leaving the "" intact) I can stop the hover showing. Now, onto my question, is there a way I can replace the 40 or so lines of:- Add("Username" , "Image URL" , "Award Reason"); with a single piece of Javascript that I could upload as an attachment? Hope that all makes sense
|
| |
![]() |
|
| Reid | Jun 12 2009, 01:39 PM Post #2 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Yeah. You copy all of the lines into notepad, save it as .js, then put this under the original code:
|
| The Resource Board | |
![]() |
|
| Lout | Jun 12 2009, 01:41 PM Post #3 |
![]() ![]()
|
Under the </script>, or just above it? Sorry but I'm a bit of a biff with coding
|
| |
![]() |
|
| Reid | Jun 12 2009, 02:00 PM Post #4 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Under your original script.
|
| The Resource Board | |
![]() |
|
| Lout | Jun 12 2009, 02:05 PM Post #5 |
![]() ![]()
|
Confused now, so it would be like this then :-
But how would the second piece of JS know that it was connected to the first piece? |
| |
![]() |
|
| Reid | Jun 12 2009, 02:12 PM Post #6 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
JS is all connected. ![]() It's all one big page of JS to the engine. |
| The Resource Board | |
![]() |
|
| Lout | Jun 12 2009, 02:56 PM Post #7 |
![]() ![]()
|
I see, I'll try it out when the wife buggers off to bed and let you know how I get on
|
| |
![]() |
|
| Lout | Jun 17 2009, 01:56 AM Post #8 |
![]() ![]()
|
Works like a dream by the way, thanks again
|
| |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Code University · Next Topic » |


















7:46 PM Jul 10