| Hey, welcome to ZBCode, the new coding forum for ZB. 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've already experienced the wonders of becoming a part of this illustrious community, just enter your details and log in here: |
| If statement with jquery | |
|---|---|
| Topic Started: Nov 21 2009, 09:24 AM (80 Views) | |
| Inadequacy | Nov 21 2009, 09:24 AM Post #1 |
|
The Inadequacy
![]()
|
So I am still trying to get good at JS (the sites I am using only go so far) so I am now resorting to asking questions. How would I do an if statement using jquery? would it be if $("top_info strong=="Swordslam46") { alert("Welcome back") } or would it be somethng else? |
|
Click Me!!! Yes they do Gor, yes they do | |
![]() |
|
| Gorgor | Nov 21 2009, 09:36 AM Post #2 |
|
Hello
![]()
|
if($("top_info strong=="Swordslam46")) { alert("Welcome back") } |
|
Wanna be a GorBoards beta tester? Just PM me. Check out the newest Exclusive Code here. | |
![]() |
|
| Inadequacy | Nov 21 2009, 09:46 AM Post #3 |
|
The Inadequacy
![]()
|
doesnt seem to work, I put top_info because top_info strong isnt an ID, I also put it above the board, should I put it in JS instead? |
|
Click Me!!! Yes they do Gor, yes they do | |
![]() |
|
| Choco | Nov 21 2009, 11:34 AM Post #4 |
|
¡ʎɹoʇɔɐɟ ʎʇıʌɐɹƃ ɐ uı pǝddɐɹʇ ɯ,ı 'dןǝɥ
![]()
|
Are you trying to check if a specific user is logged in? Then do this:
|
It's a magical world, Hobbes, ol'd buddy... ...let's go exploring!In progress: Something Special ;) | |
![]() |
|
| Gorgor | Nov 21 2009, 02:09 PM Post #5 |
|
Hello
![]()
|
Do what Choco said. All I noticed was that there wasn't a ( before the $. I didn't really look at the code
|
|
Wanna be a GorBoards beta tester? Just PM me. Check out the newest Exclusive Code here. | |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Code University · Next Topic » |

















7:31 AM Mar 12