[Zope] passing ZPT variables to Javascript

Karen Yang chefky77@yahoo.com
Sat, 12 Oct 2002 09:27:01 -0700 (PDT)


--0-1069856515-1034440021=:86254
Content-Type: text/plain; charset=us-ascii


If I defined variables in my ZPT using tal:define, how do I pass these variables to a javascript function without getting an error? 

My attempt (obviously wrong):
      <td tal:define="itemId item/id; code item/code">
      <a style="color:dodgerblue"
         tal:define="url string:${request/URL1}/processDeleteItem?itemId:int=$itemId&code=$code"
         href="javascript:doNothing()" onClick="javascript:confirmDelete('string:$code', 'string:$url')"><img src="/ItemManager/images/delete_icon" border="0"></a>
      </td>
      

Thanks,

Karen



---------------------------------
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
--0-1069856515-1034440021=:86254
Content-Type: text/html; charset=us-ascii

<P>If I defined variables in my ZPT using tal:define, how do I pass these variables to a javascript function without getting an error? </P>
<P>My attempt (obviously wrong):<BR><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td tal:define="itemId item/id; code item/code"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a style="color:dodgerblue"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:define="url string:${request/URL1}/processDeleteItem?itemId:int=$itemId&amp;code=$code"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href="javascript:doNothing()" <FONT color=#ff0000>onClick="javascript:confirmDelete('string:$code', 'string:$url')"</FONT>&gt;&lt;img src="/ItemManager/images/delete_icon" border="0"&gt;&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt;</FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P>Thanks,</P>
<P>Karen</P><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://faith.yahoo.com">Faith Hill</a> - Exclusive Performances, Videos, & more<br>
<a href="http://faith.yahoo.com">faith.yahoo.com</a>
--0-1069856515-1034440021=:86254--