Re: [Zope] RSS and JavaScript
Am Montag, 8. Januar 2001 04:11 schrieben Sie: On 7 Jan 2001 17:51:24 -0800 LARRY CHUON [EMAIL PROTECTED] wrote: Hi Zopistas, Happy New Year! --snipp-- Or do what you did before: SCRIPT LANGUAGE="JavaScript" SRC="dtml-var expr="openMe_js.absolute_url()""/SCRIPT This will also do the trick: script language="javascript" src="dtml-var openMe.js url" - Holger Use the absolute_url() method, so that the browser is sure of getting the right url for the script (which may have been your problem before). I'd use the first method as you can at least eyeball the html output of htmlPreview and see if the openMe function has acutally been include, before having to use whatever passes for javascript debugging in your browser. HTH, John ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) -- --- catWorkX GmbH Dipl.-Ing. Holger Lehmann Stresemannstr. 364 22761 Hamburg Tel: +49 (0700) catWorkX Tel: +49 (40) 890 646-0 Fax: +49 (40) 890 646-66 mailto:[EMAIL PROTECTED] http://www.catworkx.de http://www.catbridge.de ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] RSS and JavaScript
Hi all, Thank you John for your quick reply to my previous email. I've tried out both of your suggestions below. It still does work. I might have done something incorrectly as I am very new to these stuffs. Here are the steps that I've taken: 1) I create a file called openMe_js with JavaScript function. Then, I add it to the same dir as htmlPreview. The function looks something like: script language="javascript" !-- function openMe(URL){ window.open(URL,"","toolbar,status,resizable,menubar"); } //-- /script BTW, I've put this code directly in htmlPreview. 2) Next, I add one of the two methods that you've suggested to the head of htmlPreview: script language="JavaScript" dtml-var name="openMe_js" /script OR SCRIPT LANGUAGE="JavaScript" SRC="dtml-var expr="openMe_js.absolute_url()""/SCRIPT 3) Finally, I add A href="javascript:openMe('dtml-var url html_quote')"dtml-var linktext html_quote/A to one of the sections in htmlPreview. Sorry if the email is a bit lengthy. I want to be sure that I'm doing it right. Thank you all in advance to helping me. Larry On Sun, 07 January 2001, John Morton wrote: On 7 Jan 2001 17:51:24 -0800 LARRY CHUON [EMAIL PROTECTED] wrote: Hi Zopistas, Happy New Year! I'm working with SiteSummary and would like htmlPreview to grab the URL and open it up in a new window. It's not working correct. I'm unsure how Zope handle javascript either. Zope handles javascript in the same way it handles html - it just sends it to the client and let's the browser figure out what to do with it. DTML, on the other hand, is interpreted beforehand, and the results are sent to the browser. Any help is greatly appreciated. Below is my htmlPreview. I also tried to put the javascript function (I'm new to js as well) in a file and import it to the same directory as standard_html_header. Then I add SCRIPT LANGUAGE="JavaScript" SRC="openMe.js"/SCRIPT to stand_html_header. That doesn't work either. By the way, js doesn't seen to work well in Zope. I could n't find much info on-line. [cut] PA href="javascript:openMe('dtml-var url html_quote')"dtml-var linktext html_quote/A My understanding of what happens when this link is traversed is that the browser calls the javascript function 'openMe(...)', which should already defined in the page. It doesn't attempt to fetch anything from the server with that URL. So what you need to do is ensure that htmlPreview include the function openMe by either including the code into the html document like this: script language="JavaScript" dtml-var name="openMe_js" /script (note that I've replaced the dot in openMe.js with an underscore, as objects with dots in there ids need to be quoted to be used, and 1) I've forgotten how to do it 2) Searching through the documentation has given me a headache ) ...Or do what you did before: SCRIPT LANGUAGE="JavaScript" SRC="dtml-var expr="openMe_js.absolute_url()""/SCRIPT Use the absolute_url() method, so that the browser is sure of getting the right url for the script (which may have been your problem before). I'd use the first method as you can at least eyeball the html output of htmlPreview and see if the openMe function has acutally been include, before having to use whatever passes for javascript debugging in your browser. HTH, John ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Re[2]: [Zope] RSS and JavaScript
On 8 Jan 2001 08:22:15 -0800 LARRY CHUON [EMAIL PROTECTED] wrote: Hi all, Thank you John for your quick reply to my previous email. I've tried out both of your suggestions below. It still does work. I might have done something incorrectly as I am very new to these stuffs. Here are the steps that I've taken: I can't really tell you off the top of my head whether the javascript you are using is correct - it could be that that is causing the problem. 1) I create a file called openMe_js with JavaScript function. Then, I add it to the same dir as htmlPreview. The function looks something like: script language="javascript" !-- function openMe(URL){ window.open(URL,"","toolbar,status,resizable,menubar"); } //-- /script This bit looks ok. BTW, I've put this code directly in htmlPreview. Right. Then you won't need to do any of the other steps. I expect the problem is with the javascript itself. John ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] RSS and JavaScript
Hi Zopistas, Happy New Year! I'm working with SiteSummary and would like htmlPreview to grab the URL and open it up in a new window. It's not working correct. I'm unsure how Zope handle javascript either. Any help is greatly appreciated. Below is my htmlPreview. I also tried to put the javascript function (I'm new to js as well) in a file and import it to the same directory as standard_html_header. Then I add SCRIPT LANGUAGE="JavaScript" SRC="openMe.js"/SCRIPT to stand_html_header. That doesn't work either. By the way, js doesn't seen to work well in Zope. I could n't find much info on-line. Thanks in advance. script language="javascript" !-- function openMe(URL){ window.open(URL,"","toolbar,status,resizable,menubar"); } //-- /script dtml-var "getOwnerDocument()" dtml-if channelButton dtml-else dtml-call "cloneChannelButton()" /dtml-if table bgcolor="#0066CC" cellspacing=0 cellpadding=2 border=0TRTD ALIGN="CENTER" BA href="dtml-var site_url"font color="#ff"dtml-var site_title html_quotefont color/A/B /TD/TR TRTD width=146TABLE width=146 BGCOLOR="#FF" border=0 cellpadding=4 cellspacing=0TRTD BGCOLOR="#FF" DIV ALIGN="CENTER"/DIV dtml-if expr="_['meta_index']==''" dtml-in entries PA href="javascript:openMe('dtml-var url html_quote')"dtml-var linktext html_quote/A dtml-var summary html_quote/P /dtml-in dtml-else dtml-in entries PA href="javascript:openMe('dtml-var absolute_url')"dtml-var title_or_id html_quote/A dtml-if summary dtml-var summary html_quote /dtml-if /P /dtml-in /dtml-if /TD/TR/TABLE /TD/TR/TABLE ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] RSS and JavaScript
On 7 Jan 2001 17:51:24 -0800 LARRY CHUON [EMAIL PROTECTED] wrote: Hi Zopistas, Happy New Year! I'm working with SiteSummary and would like htmlPreview to grab the URL and open it up in a new window. It's not working correct. I'm unsure how Zope handle javascript either. Zope handles javascript in the same way it handles html - it just sends it to the client and let's the browser figure out what to do with it. DTML, on the other hand, is interpreted beforehand, and the results are sent to the browser. Any help is greatly appreciated. Below is my htmlPreview. I also tried to put the javascript function (I'm new to js as well) in a file and import it to the same directory as standard_html_header. Then I add SCRIPT LANGUAGE="JavaScript" SRC="openMe.js"/SCRIPT to stand_html_header. That doesn't work either. By the way, js doesn't seen to work well in Zope. I could n't find much info on-line. [cut] PA href="javascript:openMe('dtml-var url html_quote')"dtml-var linktext html_quote/A My understanding of what happens when this link is traversed is that the browser calls the javascript function 'openMe(...)', which should already defined in the page. It doesn't attempt to fetch anything from the server with that URL. So what you need to do is ensure that htmlPreview include the function openMe by either including the code into the html document like this: script language="JavaScript" dtml-var name="openMe_js" /script (note that I've replaced the dot in openMe.js with an underscore, as objects with dots in there ids need to be quoted to be used, and 1) I've forgotten how to do it 2) Searching through the documentation has given me a headache ) ...Or do what you did before: SCRIPT LANGUAGE="JavaScript" SRC="dtml-var expr="openMe_js.absolute_url()""/SCRIPT Use the absolute_url() method, so that the browser is sure of getting the right url for the script (which may have been your problem before). I'd use the first method as you can at least eyeball the html output of htmlPreview and see if the openMe function has acutally been include, before having to use whatever passes for javascript debugging in your browser. HTH, John ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )