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.

Script not counting the clicks

4 posters

Go down

Solved Script not counting the clicks

Post by Mimóza March 21st 2016, 5:40 pm

Hello,
I have added a script to my forum. It basically an easter bunny hunter script.
The problem is that it is working perfectly on my test forum, but something kills it on the forum I'd like it to work. :S

If I click on a bunny, the counter doesn't function and doesn't count the amount I caught.
See on profile: "Caught Bunny: NaN"
http://www.graphicballoon.com/u1


How can it be investigated what stops the script from working? Very Happy
Thanks for the help!


Last edited by Mimóza on March 21st 2016, 8:31 pm; edited 1 time in total
Mimóza
Mimóza
Forumember

Female Posts : 679
Reputation : 278
Language : Hungarian, English

https://graphicballoon.forumotion.com/

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ape March 21st 2016, 5:49 pm

you need to post the code you are using so we can see if it fits in with your forum or if it needs a little change


Script not counting the clicks Left1212Script not counting the clicks Center11Script not counting the clicks Right112
Script not counting the clicks Ape_b110
Script not counting the clicks Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ange Tuteur March 21st 2016, 5:55 pm

Hi @Mimóza,

I'm not sure without seeing the script, but if it's the one I think it is make sure that the default value of the profile field is set to "0" without the quotes. I think it converts it to a number, so when it converts nothing or a space it becomes
Code:
NaN
which means "Not a Number."

Example of what I mean in JavaScript :
Code:
+"10" --> 10
+"" --> 0
+"Hi" --> NaN

If that doesn't work let me know that code. ^^
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Script not counting the clicks

Post by Mimóza March 21st 2016, 6:27 pm

Why so hard. T.T

Thank you!
The Code:
Mimóza
Mimóza
Forumember

Female Posts : 679
Reputation : 278
Language : Hungarian, English

https://graphicballoon.forumotion.com/

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ange Tuteur March 21st 2016, 6:41 pm

Okay I think I figured it out. First I tested the script without a default value for my field and it saved as "NaN." Once that value is in storage the clicks will always be saved as NaN. So try forcing the default value for your field as "0" again, and then clear your browser cache and test it.

If you're using Chrome you can delete storage items like this :
F12 > Resources > Local Storage > Your Forum > right click "ghostClicks" and choose "delete"

This way you don't need to clear your cache. After that just click F5 to reload the page and see if it works. ^^
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Script not counting the clicks

Post by Mimóza March 21st 2016, 7:12 pm

Thanks for the help, Ange! I feel super lame now, but it is not working. Very Happy First I set 0 as default value and it didn't seem to work, so I set the default to 1, hoping for some miracle to happen, but it is still not working. The 'nan' is gone, but if I click on the bunny the number doesn't want to grow and stays 1.  

I cleared the cache too. Very Happy What could I miss/ do wrong?  Script not counting the clicks 1f605

It is strangely working here:
...:
Mimóza
Mimóza
Forumember

Female Posts : 679
Reputation : 278
Language : Hungarian, English

https://graphicballoon.forumotion.com/

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ape March 21st 2016, 7:44 pm

I Don't see the item your talking about in the link you are showing only a small part of your profile


Script not counting the clicks Left1212Script not counting the clicks Center11Script not counting the clicks Right112
Script not counting the clicks Ape_b110
Script not counting the clicks Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Script not counting the clicks

Post by SLGray March 21st 2016, 8:12 pm

Is this what you are referring to - Caught Bunny: 39?


Script not counting the clicks 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 : 51569
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ange Tuteur March 21st 2016, 8:19 pm

I found the problem, your forum doesn't have the jQuery JSON plugin, and part of the script utilizes that.

Create a new script in all the pages with the following content :
Code:
$.getScript('http://illiweb.com/rs3/25/frm/jquery/json/jquery.json-1.3.min.js');
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Script not counting the clicks

Post by Mimóza March 21st 2016, 8:30 pm

Woow! It's working!! Thank you soo very much, Ange! 
Script not counting the clicks 2764 Script not counting the clicks 2764 Script not counting the clicks 2764

Have a great day! Very Happy 
Solved.
Mimóza
Mimóza
Forumember

Female Posts : 679
Reputation : 278
Language : Hungarian, English

https://graphicballoon.forumotion.com/

Back to top Go down

Solved Re: Script not counting the clicks

Post by SLGray March 21st 2016, 8:31 pm

Topic solved and archived


Script not counting the clicks 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 : 51569
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Back to top


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