Archived

This topic is now archived and is closed to further replies.

  • 0

Customisation Script Error

Question

Posted · Report post

Hi,

 

I'm trying to install a fundraising script onto my site but it is causing a few errors.

 

The script is:

 

<script src='http://assets.goalsforgiving.com/gfg-charity/js/badge.js'></script><script>new Badge({ type : 'widget-badge', side : 'widget-right', css_position : 'widget-fixed', charity : 'hibbslupustrust'});</script>

 

which is placed in the header script under CSS. You can see it works in putting the badge on the right of the screen.

 

There are a few errors showing in Pingdom http://postimage.org/image/63flm4uyv/ can anyone advise what the error is? The script/badge is working successfully on other none page lines sites.

 

Script program & working site - http://charities.goalsforgiving.com/hibbslupustrust

 

My site - http://www.hibbslupustrust.org

 

Thanks!

Share this post


Link to post
Share on other sites

15 answers to this question

Posted · Report post

Hi Simon,

 

It still brings up the errors shown in Pingdom. It also affects the mobile load (the feature image isn't resized).

Share this post


Link to post
Share on other sites

Posted · Report post

can you remove that js? just to see whats going on?

Share this post


Link to post
Share on other sites

Posted · Report post

can you remove that js? just to see whats going on?
Sorry Simon when you say remove the js which part do you mean?

Share this post


Link to post
Share on other sites

Posted · Report post

Done.

Share this post


Link to post
Share on other sites

Posted · Report post

Well it isnt doing it now, all i can think of is your script has an issue with one of the other scripts on the page, and you have a lot of javascript going in.

 

prototype, scriptaculas, jquery, nextgen, lightbox, browsercheck just to name a few!! So you need to start disabling stuff to find out the conflict.

 

I tried out the code on my test setup and it worked perfectly, so we can assume its something 3rd party causing it.

Share this post


Link to post
Share on other sites

Posted · Report post

By deactivating lightbox it successfully clears the errors showing in pingdom. The only issue not is that it stops the features from changing and also resizing in mobile view.

Share this post


Link to post
Share on other sites

Posted · Report post

Figured it out... the js file is NOT compatible with jquery in wordpress, which is why it includes its own at runtime, and this in turn breaks every other script that uses jquery lol.

 

This version (attached) of the file works, so save it to your site and adjust the original script snippet to load it instead of the remote one.

badge.js.zip

Share this post


Link to post
Share on other sites

Posted · Report post

Those errors are caused by something else, disable the lightbox again

Share this post


Link to post
Share on other sites

Posted · Report post

Disabling Lightbox removes those errors. Is there any alternate to light box? It really helps when viewing items in the store rather than opening the image in a new page!

Share this post


Link to post
Share on other sites

Posted · Report post

If you think this is resolved click the button ;)

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks Simon. Really appreciate your support!!

Share this post


Link to post
Share on other sites