Archived

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

  • 0

Reloading JS attached to shortcodes


Question

Posted · Report post

Hi I'm using ajax to load pages on my site but I am also using the Facebook like button short code http://support.pagelines.me/docs/miscellaneous/shortcodes/

I need to reload the JS associated with this short code as the Facebook like button disappears when the page is loaded with JS. Could anyone assist me on the location of the file containing the JS? I have the reload code all figured out but I just need the file location.

Any assistance would be much appreciated.

Here's my homepage
http://www.priceofmilk.co.uk/

 

Link to a post where it will display normally on first load

http://www.priceofmilk.co.uk/uncategorized/testt

If you click through to a couple of posts you will notice the like button no longer shows up, it seems to display the first load of a page but if you keep clicking through posts it stops.

The button should be displayed to the left of the following text beneath the post content 'Click like to get the latest music news, hottest tracks and more via Facebook.'
 

Share this post


Link to post
Share on other sites

6 answers to this question

Posted · Report post

Well, the js is inline, if you look at that area of the page you can see it. Maybe the facebook code is designed like that to stop automated bots from mass liking pages.Just a thought, maybe a question for the facebook dev forums?

Share this post


Link to post
Share on other sites

Posted · Report post

I see the problem, which isn't a problem at all.

 

If someone has already liked your page, then the FB button greys out. If they have not liked it yet, it's blue.  As someone who's liked the page already, it appears grey to you.  If you unlike it, the button will be blue again.  Meanwhile your visitors who are seeing the page for the first time will see it blue.

 

It's actually working as it should, as Facebook doesn't allow multiple 'likes' from any one person.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for the reply but I know that's supposed to happen, which it does. However the button disappears completely due to ajax stripping the JS away, I have had to reload a couple of other plugis due to ajax doing to same thing and I just need to find the file where the shortcode draws its JS from so I can reload that file with the page load.
If you click through more than 1 post you will see the Facebook button disappear completely greyed out or not.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for the assistance. I’ve had to use the facebook iframe method of implementing a like button instead of using the pagelines shortcode.
 

Share this post


Link to post
Share on other sites

Posted · Report post

What are you using to display the Facebook button? A plugin?

Share this post


Link to post
Share on other sites