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 Gudibanda 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 Prototype API Documentation | $$ (Deprecated URL)

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 Hiemstra

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.