Jun Young wrote:
> <head>
> hello, this is template!!
> </head>
> <body>
> <a href='javascript:func_a(arg1, arg2, arg3)'>click</a>

This is a very old technique and I would not recommend using this style 
to call JavaScript functions.

Here is a more modern syntax:
<a href="#" onclick="func_a(arg1, arg2, arg3); return false;">click</a>

The most recent trend that is emerging is called "Unobtrusive 
JavaScript." This new technique separates page behavior from page 
structure and presentation. Notice the "return false;" at the end of the 
onclick attribute.

http://en.wikipedia.org/wiki/Unobtrusive_JavaScript

> </body>
> func_a().... that is my goal to call in my scripts.
> thanks you.
> </body>

I would recommend putting your JavaScript functions in an external file 
inside "public/javascripts" and include them from inside <head>:

<head>
  <%= javascript_include_tag 'application' %>
</head>

Or, if you want to also include the Prototype JavaScript libraries:

<head>
  <%= javascript_include_tag :defaults %>
</head>

Doing this will also include public/application.js along with the 
Prototype library.
-- 
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 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-talk?hl=en.

Reply via email to