shengloong
2011-Sep-11 10:57 UTC
Weird Error when Adding ShareThis Hovering Buttons to Rails
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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
soldier.coder
2011-Sep-12 08:20 UTC
Re: Weird Error when Adding ShareThis Hovering Buttons to Rails
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 Sep 11, 6:57 am, shengloong <sushenglo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 fromhttp://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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
shengloong
2011-Sep-13 08:57 UTC
Re: Weird Error when Adding ShareThis Hovering Buttons to Rails
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:20 pm, "soldier.coder" <geekprogrammer...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 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 Sep 11, 6:57 am, shengloong <sushenglo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 fromhttp://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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2011-Sep-13 09:05 UTC
Re: Re: Weird Error when Adding ShareThis Hovering Buttons to Rails
On 13 September 2011 09:57, shengloong <sushengloong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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.JS is client-side code, and nothing to do with Rails. *but* I would be looking at the source-code generated by Rails to see if any other javascript files are being included which might conflict with your "sharethis" files. Essentially, I''d be viewing the source of the two files (one Rails generated and one not) to look for differences, because something in there is confusing your browsers... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2011-Sep-13 09:20 UTC
Re: Weird Error when Adding ShareThis Hovering Buttons to Rails
On 11 September 2011 11:57, shengloong <sushengloong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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).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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Yahya Poonawala
2013-Feb-15 12:20 UTC
Re: Weird Error when Adding ShareThis Hovering Buttons to Rails
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. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Seemingly Similar Threads
- error: ordered comparison between pointer and zero ('address' (aka 'unsigned char *') and 'int')
- error: ordered comparison between pointer and zero ('address' (aka 'unsigned char *') and 'int')
- Why SI.isSigned() is not equals to E->getType()->isSignedIntegerOrEnumerationType()?
- error: ordered comparison between pointer and zero ('address' (aka 'unsigned char *') and 'int')
- [Bug 105260] New: Nouveau frequently crashes when hovering over taskbar in KDE Plasma 5