Mk 27 wrote:
> Tyler Knappe wrote:
>
>> <%= javascript_include_tag :defaults %>
>> <%= javascript_include_tag 'test' %>
>
> If testjs() is in application.js or public/javascript/test.js it should
> respond if it is formatted correctly.
Here it is! Maybe something is formatted incorrectly then?
vim public/javascripts/test.js
<script type="text/javascript">
var i = 0;
function testjs()
{
i = i + 1;
//next_week = next_week + 1;
//alert("next_week");
//alert('test');
//return next_week;
}
</script>
----
vim app/views/layouts/labs.html.erb
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag 'test' %>
----
vim app/views/labs/show.html.erb
<%= link_to_function 'Next Week Test', "testjs()" %>
----
The errors:
missing } in XML expression
[Break on this error] i = i + 1;\n
test.js?...244134114 (line 5)
The second error, below, shows up when I click on the 'Next Week' link
within the show view.
testjs is not defined
[Break on this error] testjs();
I don't see anything wrong, everything should be included.
--
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
-~----------~----~----~----~------~----~------~--~---