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 July 3rd 2014, 4:37 pm

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 July 3rd 2014, 4:53 pm; 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 July 3rd 2014, 4:48 pm

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 July 3rd 2014, 4:55 pm

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 July 3rd 2014, 4:56 pm

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 July 3rd 2014, 6:44 pm

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 : 51583
Reputation : 3526
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