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

Y

Yvan J. Gagnon

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,
- (e-mail address removed)
 
M

Marc

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?
 
R

Richard Hockey

Yvan J. Gagnon said:
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.

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.
 
Y

Yvan J. Gagnon

Richard Hockey said:
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.


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
 
M

Marc

Yvan J. Gagnon said:
"Richard Hockey" <[email protected]> wrote in message


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

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top