The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Word Counter Issue

3 posters

Go down

Solved Word Counter Issue

Post by PA 03.07.14 15:37

This is a relatively simple problem with a simple answer and yet my javascript is wayy to bad.

So I used forumotions word counter for my forum but I wanted it to only apply to a few forums, so I implemented:



Code:
if ($('a.nav[href^="/c1-"]').length == 0)

At the top of the code.
And it works, but I want to know how to apply it to several forums.
Like only category 1, 4 and 5.
It should just be a simple or operator but it's not working.


Last edited by PA on 03.07.14 15:53; edited 2 times in total
avatar
PA
Forumember

Posts : 219
Reputation : 2
Language : english

Back to top Go down

Solved Re: Word Counter Issue

Post by levy 03.07.14 15:48

Hi,
From my basic Js knowledges, you can create how much if statment you want, and you don't need something else than this:
Code:
if ($('a.nav[href^="/c1-"]').length == 0)
if ($('a.nav[href^="/c4-"]').length == 0)
if ($('a.nav[href^="/c5-"]').length == 0)

I'm not very sure if it will work, you can try it or you can wait for Ange Tuteur. Smile
levy
levy
Hyperactive

Male Posts : 2631
Reputation : 350
Language : English, Romanian
Location : Romania

https://portofolio.goodforum.net/

Back to top Go down

Solved Re: Word Counter Issue

Post by PA 03.07.14 15:55

I tried it like this:

Code:
 if ($('a.nav[href^="/c1-"]').length == 0);
if ($('a.nav[href^="/c3-"]').length == 0) return;

Didnt work
avatar
PA
Forumember

Posts : 219
Reputation : 2
Language : english

Back to top Go down

Solved Re: Word Counter Issue

Post by PA 03.07.14 15:56

Nevermind, it worked! Hah..
WOW
avatar
PA
Forumember

Posts : 219
Reputation : 2
Language : english

Back to top Go down

Solved Re: Word Counter Issue

Post by SLGray 03.07.14 17:44

Problem solved & topic archived.


Word Counter Issue Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51554
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum