Jump to content


Photo
- - - - -

Reloading JS attached to shortcodes

ajax js short code facebook

Best Answer Simon_P , 29 January 2013 - 10:17 PM

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?

Go to the full post


  • Please log in to reply
6 replies to this topic

#1 LukeB

LukeB

    Super Member

  • Members
  • 139 posts
  • Framework Version:2.4.1
  • Country: Country Flag

Posted 29 January 2013 - 03:15 PM

Hi I'm using ajax to load pages on my site but I am also using the Facebook like button short code

Please Login or Register to see this Hidden Content



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

Please Login or Register to see this Hidden Content

 

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

Please Login or Register to see this Hidden Content



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.'
 



#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 29 January 2013 - 06:41 PM

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



#3 LukeB

LukeB

    Super Member

  • Members
  • 139 posts
  • Framework Version:2.4.1
  • Country: Country Flag

Posted 29 January 2013 - 07:41 PM

I'm just using the framework shortcodes

Please Login or Register to see this Hidden Content

 

Please Login or Register to see this Hidden Content



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 29 January 2013 - 09:50 PM

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.



#5 LukeB

LukeB

    Super Member

  • Members
  • 139 posts
  • Framework Version:2.4.1
  • Country: Country Flag

Posted 29 January 2013 - 10:15 PM

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.



#6 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 29 January 2013 - 10:17 PM   Best Answer

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?



#7 LukeB

LukeB

    Super Member

  • Members
  • 139 posts
  • Framework Version:2.4.1
  • Country: Country Flag

Posted 12 February 2013 - 11:43 AM

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







Also tagged with one or more of these keywords: ajax, js, short code, facebook