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

Discussion in 'Javascript' started by Yvan J. Gagnon, Jul 9, 2003.

  1. 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 J. Gagnon, Jul 9, 2003
    #1
    1. Advertising

  2. Yvan J. Gagnon

    Marc Guest

    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" <> wrote in message
    news:...
    > 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,
    > -
    Marc, Jul 10, 2003
    #2
    1. Advertising

  3. "Yvan J. Gagnon" <> wrote in message
    news:...
    > 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.

    >Has
    > anyone else encountered this problem? If so, is there a fix for it,
    > and if so, what is it?
    >
    > thanks,
    > -
    Richard Hockey, Jul 10, 2003
    #3
  4. "Richard Hockey" <> wrote in message news:<3f0caa8d$0$960$>...
    > "Yvan J. Gagnon" <> wrote in message
    > news:...
    > > 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.
    >
    > >Has
    > > anyone else encountered this problem? If so, is there a fix for it,
    > > and if so, what is it?
    > >
    > > thanks,
    > > -



    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
    Yvan J. Gagnon, Jul 10, 2003
    #4
  5. Yvan J. Gagnon

    Marc Guest

    "Yvan J. Gagnon" <> wrote in message
    news:...
    > "Richard Hockey" <> wrote in message

    news:<3f0caa8d$0$960$>...
    > > "Yvan J. Gagnon" <> wrote in message
    > > news:...
    > > > 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.
    > >
    > > >Has
    > > > anyone else encountered this problem? If so, is there a fix for it,
    > > > and if so, what is it?
    > > >
    > > > thanks,
    > > > -

    >
    >
    > 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?
    Marc, Jul 10, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,014
    David Binnie
    Mar 17, 2006
  2. Grey
    Replies:
    0
    Views:
    299
  3. Sebastian Faust
    Replies:
    6
    Views:
    2,198
    Kevin Saff
    Oct 30, 2003
  4. nickolausp
    Replies:
    1
    Views:
    103
    Dom Leonard
    Jul 18, 2003
  5. Replies:
    2
    Views:
    83
Loading...

Share This Page