Proper usage is like this
function create_part( element_id ) {
foo = '<h1>test</h1>'
$( element_id ).insert( { top: foo} );
}
--- OR ---
function create_part( element_id ) {
foo = '<h1>test</h1>'
Element.insert( $( element_id ) , { position: content } );
}
Someone correct me if I'm wrong
On Nov 24, 1:38 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I have implemented the following function into my application.js
>
> function create_part( element_id ) {
> foo = '<h1>test</h1>'
> $( element_id ).insert( foo , { position: content } )
>
> }
>
> If i call this function i get the following error in the Error-
> console:
>
> Fehler: $(element_id).insert is not a function
> Quelldatei:http://localhost:3000/javascripts/application.js?1195905778
> Zeile: 3
>
> If I hav a look at the examples inhttp://www.prototypejs.org/api/element
> I cannot see an error in my definition, and the function should be
> recognized if I have included the prototype.js, what I have...
>
> If i test with alert( $(element_id)), the id of the element will pop-
> up. So it should be working. That why I am a bit confused?
>
> Some ideas ?
>
> cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---