Hi all, I am trying to add the ShareThis Hovering buttons to my Rails 3 application but have no luck. I got the embed code from http://sharethis.com/publishers/get-hovering-buttons. In order to prove that the problem is specific to Rails, I put the same code into a HTML file outside the rails app and also a pure HTML file inside the public directory (without routed to controller) of my rails app. It turns out that the HTML file outside the rails app works but the one inside the public directory threw an error "Uncaught TypeError: Cannot read property 'length' of undefined" at load.js:1 (obtained by google chrome error console). Any help will be appreciated! Regards, Sheng-Loong.
on 2011-09-11 17:11
on 2011-09-12 10:22
Sheng-Loong, I bet no one wants to have to go to a site, agree to licensing agreement, and then fill out a form so they can help you with your problem. The morale of the story is: if you want help, make it easy for people to see your problem
on 2011-09-13 11:08
soldier.coder, I believe I provided all the information I could in my last email. I admit that I should attach the source code. So here it is at http://pastebin.com/9i4D6zpQ. I put this piece of code (without any other line of code) into two files - one outside my rails app directory and another one in the public directory. In the end, only the one outside the rails app directory works so I believe this problem is pertaining to the rails framework. Note that I didn't even route to a controller to render the view. I am sorry for not structuring my question properly in the last email. I am new here, please have mercy on me =) Regards, shengloong On Sep 12, 4:20pm, "soldier.coder" <geekprogrammer...@googlemail.com>
on 2011-09-13 11:08
on 2011-09-13 11:22
On 11 September 2011 11:57, shengloong <firstname.lastname@example.org> wrote: > read property 'length' of undefined" at load.js:1 (obtained by google > chrome error console). Try using Firebug in firefox to display the page and see if it shows any errors. Also check the html is fully valid using the w3c html validator. Colin
on 2013-02-15 13:20
The problem is with the domain name as loader.js tries to do a split on the domain name. So if you are hitting the page localhost:3000 which has the sharethis widget it will not show up as it cannot split localhost. However if you map your machine(127.0.0.1) to something like a.b then loader.js can split it and the ShareThis widget will show up.