javascript redirects in zope
I am trying to do a redirect in javascript by setting the location object to a passed in URL. It doesn't seem to work in Zope and has always worked in JSP or any other HTML file. Is there any zope restriction prohibiting this code to work? Any suggestions for a workaround? My function: (shows the confirm window, but then does not redirect after I answer 'Yes') function confirmDelete(code, url) { var resp = window.confirm("Delete item " + code + "?"); if (resp) { location.href=unescape(url); /** also tried location=unescape(url); and document.location=unescape(url) but didn't work **/ } } Thank you. Karen --------------------------------- Do you Yahoo!? Faith Hill - Exclusive Performances, Videos, & more faith.yahoo.com
Hi Karen, first of all - whats the use of this Javascript code? Its not good style to make a page depending on javascript to work. However, there is no reason it would not work if you do it correctly. Zope does only send content to the browser. If the page is in the browser, Zope does not have any influence on it. This is the concept of any HTTP request/response. If the code does not work, inspect it in your browser. how is the URL made? Is it may be constructed in a way zope had to quote it before inserting into your page? Is your whole Script quoted? This may happen, if you insert it into your ZPT without structure. Regards Tino --On Sonntag, 13. Oktober 2002 07:32 -0700 Karen Yang <chefky77@yahoo.com> wrote:
I am trying to do a redirect in javascript by setting the location object to a passed in URL. It doesn't seem to work in Zope and has always worked in JSP or any other HTML file. Is there any zope restriction prohibiting this code to work? Any suggestions for a workaround?
My function: (shows the confirm window, but then does not redirect after I answer 'Yes') function confirmDelete(code, url) { var resp = window.confirm("Delete item " + code + "?"); if (resp) { location.href=unescape(url);
/** also tried location=unescape(url); and document.location=unescape(url)
but didn't work **/ } }
Thank you.
Karen
__________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos, & more faith.yahoo.com
participants (2)
-
Karen Yang -
Tino Wildenhain