I changed the <head> node to this, but it's still not reaching my lookup
action in the controller:
<head>
<script type="text/javascript"
src="javascripts/prototype.js"></script>
<script type="text/javascript"
src="javascripts/effects.js"></script>
<script type="text/javascript">
//<![CDATA[
//don't forget to add <body ondblclick="dictionary()">
function dictionary() {
var t = document.getSelection();
//alert(t);
od(t);
}
function od(t) {
//t=t.replace(/[!.:?,;"]/, '');
//while (t.substr(t.length-1,1)==' ')
// t=t.substr(0,t.length-1);
//while (t.substr(0,1)==' ')
// t=t.substr(1);
//alert(t);
if (t) {
alert('moving forward');
<%= remote_function(:update => "definition_box", :url => { :action =>
:lookup } ) %>
}
}
//]]>
</script>
</head>
Frederick Cheung wrote:
> On 24 Jun 2009, at 15:16, Naija Guy wrote:
>
>> remote_function, but then my debug statement in the controller action
>> never spits out anything to the server console!
>>
> You should enclose your code in a CDATA section (
> http://stackoverflow.com/questions/66837/javascript-cdata-tags
> ).
>
> Fred
--
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
-~----------~----~----~----~------~----~------~--~---