why is it that no matter how long you bang your head beforhand the
solution always presents itself AFTER you post to a list about it?
this is only 1/2 a solution though and doesn''t address the underlying
problem of not being able to have it not poke at the string
there were some " vs '' issues in there which while making a valid
string would have broken the js. when i cleaned those up the problem
went away. BUT what if i NEED to pass in something a bit funkf and
guarantee it doesn''t get touched? How do you do that?
What worked (cleaned quotes) for this instance of problem:
<%on_click = ''javascript:if(confirm(\''This will delete
it\\\''s related
attributes too. Ok?\'')){document.location=\''''+
url_for(:action =>
''destroy'', :id =>
@item_attribute_group.id)+''\'';}''%>
On 5/14/05, kate rhodes <masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> PROBLEM: string won''t NOT get interpreted / parsed.
> How do I make it leave my string alone?
>
> SETUP: a partial with named parameters passed to it
> the partial:
> <div class="my_div" onClick="<%= on_click
%>">
> </div>
> THE CALL:
> <%on_click = ''javascript:if(confirm("This will delete
it\''s related
> attributes too. Ok?"){document.location="''+
url_for(:action =>
> ''destroy'', :id =>
@item_attribute_group.id)+''";}''%>
> <%=on_click%>
> <%= render_partial
''common_partials/pink_round_button'', nil,
> {''button_text'' => ''Delete'',
''on_click''=>on_click} %>
>
> THE RESULT:
> AFTER being passed to the partial on_click becomes
> javascript:if(confirm(" this="" will=""
delete="" it''s="" related=""
> attributes="" too="" ok=""
> ){document.location="/item_attribute_groups/destroy/4" ;="
>
> see the problem? :(
>
> BEFORE it was what you''d expect
> javascript:if(confirm("This will delete it''s related
attributes too.
> Ok?"){document.location="/item_attribute_groups/destroy/4";}
>
> --
> -Kate
> (masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org)
>
--
-Kate
(masukomi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org)