Thread View: comp.lang.java.programmer
3 messages
3 total messages
Started by Javier Pulido
Mon, 11 Sep 2000 16:20
Netscape don't catch the Cookies within javascript function?
Author: Javier Pulido
Date: Mon, 11 Sep 2000 16:20
Date: Mon, 11 Sep 2000 16:20
35 lines
2430 bytes
2430 bytes
Could somebody help me?
I'm trying to get a dinamic image generated by a Servlet, which is called by
IMG tag. This servlet sends a cookie to the browser too, but as the url of
the servlet has to be generated dinamically, I have used a javascript
function. When I set the src of IMG using a javascript function, the cookies
are ignored in Netscape, but in Internet Explorer it runs fine.
Why? Are there other way to do the same?
A example of my HTML page
<HTML>
<HEAD>
<META http-equiv="Pragma" content="no-cache">
<META http-equiv="Expires" content="Monday, 01-Jan-90 00:00:00 GMT">
<SCRIPT language="javascript">
var dir=null;
function direction()
{
dir="http://localhost/servlet/MyServlet";
var now=new Date();
var cad=dir+"?keyGroup=0&main="+document.URL+"&time="+now;
document.button.src=cad;
return(true);
}
</SCRIPT>
</HEAD>
<BODY>
<IMG src="javascript:direction()" NAME="button">
</BODY>
</HTML>
Re: Netscape don't catch the Cookies within javascript function?
Author: Andre-John Mas
Date: Mon, 11 Sep 2000 22:35
Date: Mon, 11 Sep 2000 22:35
54 lines
2746 bytes
2746 bytes
I suggest that you try the comp.lang.javascript
newsgroup as this appears to be very much a Javascript problem.
Andre
In article <ID7v5.60659$Z05.877917@telenews.teleline.es>,
"Javier Pulido" <fjpulido@ua.es> wrote:
> Could somebody help me?
>
> I'm trying to get a dinamic image generated by a Servlet, which is
called by
> IMG tag. This servlet sends a cookie to the browser too, but as the
url of
> the servlet has to be generated dinamically, I have used a javascript
> function. When I set the src of IMG using a javascript function, the
cookies
> are ignored in Netscape, but in Internet Explorer it runs fine.
> Why? Are there other way to do the same?
>
> A example of my HTML page
>
> <HTML>
> <HEAD>
> <META http-equiv="Pragma" content="no-cache">
> <META http-equiv="Expires" content="Monday, 01-Jan-90 00:00:00 GMT">
>
> <SCRIPT language="javascript">
> var dir=null;
>
> function direction()
> {
> dir="http://localhost/servlet/MyServlet";
> var now=new Date();
> var cad=dir+"?keyGroup=0&main="+document.URL+"&time="+now;
> document.button.src=cad;
>
> return(true);
> }
> </SCRIPT>
> </HEAD>
>
> <BODY>
> <IMG src="javascript:direction()" NAME="button">
> </BODY>
> </HTML>
>
>
--
http://www.bigfoot.com/~ajmas/
Sent via Deja.com http://www.deja.com/
Before you buy.
Re: Netscape don't catch the Cookies within javascript function?
Author: Andre-John Mas
Date: Mon, 11 Sep 2000 22:37
Date: Mon, 11 Sep 2000 22:37
16 lines
1660 bytes
1660 bytes
In article <8pjmn2$heo$1@nnrp1.deja.com>, Andre-John Mas <ajmas@bigfoot.com> wrote: > I suggest that you try the comp.lang.javascript > newsgroup as this appears to be very much a Javascript problem. > Oops, didn't realise this had been cross-posted. Andre -- http://www.bigfoot.com/~ajmas/ Sent via Deja.com http://www.deja.com/ Before you buy.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads