[Laszlo-user] Probelms with settings cookies in Open Laszlo 3.2 release
Chandra Shekhar Reddy Potula
pchandrashekharreddy at yahoo.co.in
Mon Jun 19 10:55:28 EDT 2006
Hello everybody,
I had hard time to set cookie by using lps3.2 release.
I have a laszlo method as given below.
<method event="onclick">
<![CDATA[
LzBrowser.loadJS("document.cookie='NoticePage=xyz'");
// wait 1/2 sec for the cookie to be set before changing the page
LzTimer.resetTimer(new LzDelegate(this, 'opendefault'), 500);
]]>
</method>
<method name="opendefault">
LzBrowser.loadJS("top.location='Default.html'");
</method>
from my javascript I am trying to retrive the same cookie but there is no cookie
set at the browser side.
<script type="text/javascript">
function getCookie(name)
{
var prefix = name + "="
var cookieStartIndex = document.cookie.indexOf(prefix)
if (cookieStartIndex == -1)
return null
var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex +
prefix.length)
if (cookieEndIndex == -1)
cookieEndIndex = document.cookie.length
return unescape(document.cookie.substring(cookieStartIndex +
prefix.length, cookieEndIndex))
}
function window.onload(){
var noticePage = getCookie("'NoticePage");
alert(" Document Cookies are... \n" + document.cookie);
if (NoticeCode == null){
document.all.contentView.src ="./lzx/notice.lzx?lzt=html";
document.all.contentView.style.visibility = "visible";
}
}
</script>
is there any bug with lps 3.2 release because the above code is working fine with lps 3.1 release.
So Is there any other way to do the same?
Thanks in Advance
Chandra
---------------------------------
Yahoo! India Answers: Share what you know. Learn something new Click here
Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20060619/8d819316/attachment.html
More information about the Laszlo-user
mailing list