The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Script not counting the clicks

View previous topic View next topic Go down

Solved Script not counting the clicks

Post by Mimóza on 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
Forumember

Female Posts : 578
Reputation : 245
Language : •ᴗ•
Location : Hungary

http://dianagyms.deviantart.com/gallery/

Back to top Go down

Solved Re: Script not counting the clicks

Post by APE on 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





APE
Manager
Manager

Male Posts : 8648
Reputation : 762
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Script not counting the clicks

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

Why so hard. T.T

Thank you!
The Code:

Mimóza
Forumember

Female Posts : 578
Reputation : 245
Language : •ᴗ•
Location : Hungary

http://dianagyms.deviantart.com/gallery/

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Script not counting the clicks

Post by Mimóza on 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?  

It is strangely working here:
...:

Mimóza
Forumember

Female Posts : 578
Reputation : 245
Language : •ᴗ•
Location : Hungary

http://dianagyms.deviantart.com/gallery/

Back to top Go down

Solved Re: Script not counting the clicks

Post by APE on 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





APE
Manager
Manager

Male Posts : 8648
Reputation : 762
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

Solved Re: Script not counting the clicks

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

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


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


SLGray
Administrator
Administrator

Male Posts : 36748
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Script not counting the clicks

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Script not counting the clicks

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

Woow! It's working!! Thank you soo very much, Ange! 
  

Have a great day! Very Happy 
Solved.

Mimóza
Forumember

Female Posts : 578
Reputation : 245
Language : •ᴗ•
Location : Hungary

http://dianagyms.deviantart.com/gallery/

Back to top Go down

Solved Re: Script not counting the clicks

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

Topic solved and archived


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


SLGray
Administrator
Administrator

Male Posts : 36748
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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