Can i use scrtipaculous functions in helpers?

Hi,

I need to rip off some data from webpage. Looking at the DOM structure
of that page, i figured out i need to use getElementsByClassName
provided by scriptaculous.

I wonder if i can use call Javascript fucntions(getElementsByClassName)
in helpers?

Regards,
Sandeep G

Sandeep G. wrote:

Hi,

I need to rip off some data from webpage. Looking at the DOM structure
of that page, i figured out i need to use getElementsByClassName
provided by scriptaculous.

I wonder if i can use call Javascript fucntions(getElementsByClassName)
in helpers?

Regards,
Sandeep G
This function is not provided by scriptaculous but by the prototype js
library (www.prototypejs.org).
Anyway this function is deprecated but you can use the utility method $$
instead.
See http://www.prototypejs.org/api/utility/dollar-dollar

If you have added the javascript_include_tag :defaults in the head of
your page u can use all of the prototype and scriptaculous functions in
your app.

Regards,
Danny H.

On 4 May 2008, at 08:34, Sandeep G. wrote:

If what you’re saying is that you want to use these javascript
functions to help you do some screen scraping from your ruby process
then the answer is no (your ruby process doesn’t even have a
javascript interpreter for starters). Use somthing like Hpricot.

Fred

Thanks Fred!! I thank you so often :slight_smile: I guess this should work for me.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs