Connecting Tech Pros Worldwide Forums | Help | Site Map

Probelm with cfoutput / document.write JS function in Netscape 7

Yvan J. Gagnon
Guest
 
Posts: n/a
#1: Jul 20 '05
I am encountering a strange problem in Netscape 7 with a CFM file I am
trying to troubleshoot (the page is working fine in NS Communicator
and IE). Below is a sample of the problematic line of javascript code.
Note that in the actual file, I've surrounded the variable
'#cookie.cookiename#' with CFOUTPUT tags:

document.write('<input type="Hidden" name="affiliate"
value="#cookie.cookiename#">');

When I load the document in Netscape 7, I get a CF Error message, like
the #cookie.cookiename# variable isn't being replaced with the actual
value (the cfoutput tags are being ignored). I suspect that it's a bug
of some kind in NS 7's implementation of the document.write javascript
function, and am hoping that there is some kind of workaround. Has
anyone else encountered this problem? If so, is there a fix for it,
and if so, what is it?

thanks,
- yvan@ideasdesigninc.com
Marc
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Probelm with cfoutput / document.write JS function in Netscape 7


you'd better try an Coldfusion newsgroup...
My gues is that the cookie isn't been written
properly...
what does the CF error look like?

"Yvan J. Gagnon" <yvan@ideasdesign.com> wrote in message
news:cb4ee677.0307090927.4210df7d@posting.google.c om...[color=blue]
> I am encountering a strange problem in Netscape 7 with a CFM file I am
> trying to troubleshoot (the page is working fine in NS Communicator
> and IE). Below is a sample of the problematic line of javascript code.
> Note that in the actual file, I've surrounded the variable
> '#cookie.cookiename#' with CFOUTPUT tags:
>
> document.write('<input type="Hidden" name="affiliate"
> value="#cookie.cookiename#">');
>
> When I load the document in Netscape 7, I get a CF Error message, like
> the #cookie.cookiename# variable isn't being replaced with the actual
> value (the cfoutput tags are being ignored). I suspect that it's a bug
> of some kind in NS 7's implementation of the document.write javascript
> function, and am hoping that there is some kind of workaround. Has
> anyone else encountered this problem? If so, is there a fix for it,
> and if so, what is it?
>
> thanks,
> - yvan@ideasdesigninc.com[/color]


Richard Hockey
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Probelm with cfoutput / document.write JS function in Netscape 7



"Yvan J. Gagnon" <yvan@ideasdesign.com> wrote in message
news:cb4ee677.0307090927.4210df7d@posting.google.c om...[color=blue]
> I am encountering a strange problem in Netscape 7 with a CFM file I am
> trying to troubleshoot (the page is working fine in NS Communicator
> and IE). Below is a sample of the problematic line of javascript code.
> Note that in the actual file, I've surrounded the variable
> '#cookie.cookiename#' with CFOUTPUT tags:
>
> document.write('<input type="Hidden" name="affiliate"
> value="#cookie.cookiename#">');
>
> When I load the document in Netscape 7, I get a CF Error message, like
> the #cookie.cookiename# variable isn't being replaced with the actual
> value (the cfoutput tags are being ignored).[/color]
[color=blue]
>I suspect that it's a bug
> of some kind in NS 7's implementation of the document.write javascript
> function, and am hoping that there is some kind of workaround.[/color]

Since you are getting a CF error message, it is unlikely the problem is with
Netscape, since the CF is processed on the server before the page is sent to
the browser. Is netscape affecting the cookie being set?

Check the CF code that sets the cookie. If I remember correctly you can't
use the cflocation tag and set cookie values in the same script, this might
be something to check for.
[color=blue]
>Has
> anyone else encountered this problem? If so, is there a fix for it,
> and if so, what is it?
>
> thanks,
> - yvan@ideasdesigninc.com[/color]


Yvan J. Gagnon
Guest
 
Posts: n/a
#4: Jul 20 '05

re: Probelm with cfoutput / document.write JS function in Netscape 7


"Richard Hockey" <richardhockey@dsl.pipex.com> wrote in message news:<3f0caa8d$0$960$cc9e4d1f@news.dial.pipex.com> ...[color=blue]
> "Yvan J. Gagnon" <yvan@ideasdesign.com> wrote in message
> news:cb4ee677.0307090927.4210df7d@posting.google.c om...[color=green]
> > I am encountering a strange problem in Netscape 7 with a CFM file I am
> > trying to troubleshoot (the page is working fine in NS Communicator
> > and IE). Below is a sample of the problematic line of javascript code.
> > Note that in the actual file, I've surrounded the variable
> > '#cookie.cookiename#' with CFOUTPUT tags:
> >
> > document.write('<input type="Hidden" name="affiliate"
> > value="#cookie.cookiename#">');
> >
> > When I load the document in Netscape 7, I get a CF Error message, like
> > the #cookie.cookiename# variable isn't being replaced with the actual
> > value (the cfoutput tags are being ignored).[/color]
>[color=green]
> >I suspect that it's a bug
> > of some kind in NS 7's implementation of the document.write javascript
> > function, and am hoping that there is some kind of workaround.[/color]
>
> Since you are getting a CF error message, it is unlikely the problem is with
> Netscape, since the CF is processed on the server before the page is sent to
> the browser. Is netscape affecting the cookie being set?
>
> Check the CF code that sets the cookie. If I remember correctly you can't
> use the cflocation tag and set cookie values in the same script, this might
> be something to check for.
>[color=green]
> >Has
> > anyone else encountered this problem? If so, is there a fix for it,
> > and if so, what is it?
> >
> > thanks,
> > - yvan@ideasdesigninc.com[/color][/color]


As I had implied, I suspect that this is an issue with Netscape's
improper handling of the Javascript document.write function when
combined with dynamic Cold Fusion content.

When I view the document source code in Netscape 7, I see the
beginning part of the javascript code, and then right where the
variable is supposed to be displayed, I get something like the
following:

document.write('<input type="hidden" name="affiliate"
value="</td></tr></table></td></tr></table>

(etc., etc., -- where the CF error message gets displayed.)

What's strange is that the page is designed to have the affiliate
value passed to it via the query string (ie:
index.cfm?referrer=companyname). And when I pass a value to it in
Netscape 7, the page loads fine (no errors), -- and loads fine
afterwards, --- even when no value is passed to it via the query
string. But as soon as I delete the cookie and try to access the page
again without passing a value to it, I get the CF error message.
Again, I do not get this behavior when accessing the page in IE, with
our without a referrer being passed to it.

- yvan
Marc
Guest
 
Posts: n/a
#5: Jul 20 '05

re: Probelm with cfoutput / document.write JS function in Netscape 7



"Yvan J. Gagnon" <yvan@ideasdesign.com> wrote in message
news:cb4ee677.0307100657.33bffd8c@posting.google.c om...[color=blue]
> "Richard Hockey" <richardhockey@dsl.pipex.com> wrote in message[/color]
news:<3f0caa8d$0$960$cc9e4d1f@news.dial.pipex.com> ...[color=blue][color=green]
> > "Yvan J. Gagnon" <yvan@ideasdesign.com> wrote in message
> > news:cb4ee677.0307090927.4210df7d@posting.google.c om...[color=darkred]
> > > I am encountering a strange problem in Netscape 7 with a CFM file I am
> > > trying to troubleshoot (the page is working fine in NS Communicator
> > > and IE). Below is a sample of the problematic line of javascript code.
> > > Note that in the actual file, I've surrounded the variable
> > > '#cookie.cookiename#' with CFOUTPUT tags:
> > >
> > > document.write('<input type="Hidden" name="affiliate"
> > > value="#cookie.cookiename#">');
> > >
> > > When I load the document in Netscape 7, I get a CF Error message, like
> > > the #cookie.cookiename# variable isn't being replaced with the actual
> > > value (the cfoutput tags are being ignored).[/color]
> >[color=darkred]
> > >I suspect that it's a bug
> > > of some kind in NS 7's implementation of the document.write javascript
> > > function, and am hoping that there is some kind of workaround.[/color]
> >
> > Since you are getting a CF error message, it is unlikely the problem is[/color][/color]
with[color=blue][color=green]
> > Netscape, since the CF is processed on the server before the page is[/color][/color]
sent to[color=blue][color=green]
> > the browser. Is netscape affecting the cookie being set?
> >
> > Check the CF code that sets the cookie. If I remember correctly you[/color][/color]
can't[color=blue][color=green]
> > use the cflocation tag and set cookie values in the same script, this[/color][/color]
might[color=blue][color=green]
> > be something to check for.
> >[color=darkred]
> > >Has
> > > anyone else encountered this problem? If so, is there a fix for it,
> > > and if so, what is it?
> > >
> > > thanks,
> > > - yvan@ideasdesigninc.com[/color][/color]
>
>
> As I had implied, I suspect that this is an issue with Netscape's
> improper handling of the Javascript document.write function when
> combined with dynamic Cold Fusion content.
>
> When I view the document source code in Netscape 7, I see the
> beginning part of the javascript code, and then right where the
> variable is supposed to be displayed, I get something like the
> following:
>
> document.write('<input type="hidden" name="affiliate"
> value="</td></tr></table></td></tr></table>
>
> (etc., etc., -- where the CF error message gets displayed.)
>
> What's strange is that the page is designed to have the affiliate
> value passed to it via the query string (ie:
> index.cfm?referrer=companyname). And when I pass a value to it in
> Netscape 7, the page loads fine (no errors), -- and loads fine
> afterwards, --- even when no value is passed to it via the query
> string. But as soon as I delete the cookie and try to access the page
> again without passing a value to it, I get the CF error message.
> Again, I do not get this behavior when accessing the page in IE, with
> our without a referrer being passed to it.
>
> - yvan[/color]

Oke, but still CF is being interpreted on the server... so CF doesn't
know about the javascript... What is the CF error??
Is there an extra # in the cookie variable?


Closed Thread