Klugdy CF Prevents Javascript From Executing?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Hill

    Klugdy CF Prevents Javascript From Executing?

    I have this cf script below where the javascript in it works perfectly i.e.
    a new window opens when I press 'click me' when I call it up using the url
    in the browser.

    But when I "POST" to it from another script the javascript window does not
    open when I click "click me".

    Is cf writing something kludgy to the browser when I post to it causing the
    javascript not to execute??

    Any help is appreciated.
    Mike


    <CFSETTING ENABLECFOUTPUTO NLY="YES">
    <cfcontent type="image/svg+xml">
    <cfoutput>
    <svg width="1024px" height="626px" onload="initsvg (evt)" viewBox="0 0 1024
    626" preserveAspectR atio="none" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="ht tp://www.w3.org/1999/xlink">
    <title>Graphi c</title>
    <defs>
    <script language="JavaS cript">
    <![CDATA[
    var svgObj;
    function initsvg(evt)
    {
    if ( window.svgDocum ent == null )
    {
    svgDocument = evt.target.owne rDocument;
    }
    svgObj = svgDocument.doc umentElement;
    }
    function goDetail()
    {
    var myurl = "";
    var detailwin = open( myurl, "detail",
    "toolbar=no,scr ollbars=yes,wid th=600,height=5 00,dependent=no ,resizable=yes, t
    op=50,left=50") ;
    detailwin.focus ();
    }
    ]]>
    </script>
    </defs>
    <g transform="tran slate(35,177)" onclick="goDeta il();">
    <text font-family="Arial" font-size="10" font-weight="bold"
    fill="##000000" >
    click me
    <set attributeName=" fill" attributeType=" CSS" to="##FF0000"
    begin="mouseove r" end="mouseout"/>
    <set attributeName=" fill" attributeType=" CSS" to="##FF0000"
    begin="mousedow n" end="mouseup"/>
    </text>
    </g>
    </svg>
    </cfoutput>
    <CFSETTING ENABLECFOUTPUTO NLY="No">


  • Michael Hill

    #2
    Re: Klugdy CF Prevents Javascript From Executing?



    Michael Hill wrote:[color=blue]
    >
    > I have this cf script below where the javascript in it works perfectly i.e.
    > a new window opens when I press 'click me' when I call it up using the url
    > in the browser.
    >
    > But when I "POST" to it from another script the javascript window does not
    > open when I click "click me".
    >
    > Is cf writing something kludgy to the browser when I post to it causing the
    > javascript not to execute??
    >
    > Any help is appreciated.
    > Mike
    >
    > <CFSETTING ENABLECFOUTPUTO NLY="YES">
    > <cfcontent type="image/svg+xml">
    > <cfoutput>
    > <svg width="1024px" height="626px" onload="initsvg (evt)" viewBox="0 0 1024
    > 626" preserveAspectR atio="none" xmlns="http://www.w3.org/2000/svg"
    > xmlns:xlink="ht tp://www.w3.org/1999/xlink">
    > <title>Graphi c</title>
    > <defs>
    > <script language="JavaS cript">
    > <![CDATA[
    > var svgObj;
    > function initsvg(evt)
    > {
    > if ( window.svgDocum ent == null )
    > {
    > svgDocument = evt.target.owne rDocument;
    > }
    > svgObj = svgDocument.doc umentElement;
    > }
    > function goDetail()
    > {
    > var myurl = "";
    > var detailwin = open( myurl, "detail",
    > "toolbar=no,scr ollbars=yes,wid th=600,height=5 00,dependent=no ,resizable=yes, t
    > op=50,left=50") ;
    > detailwin.focus ();
    > }
    > ]]>
    > </script>
    > </defs>
    > <g transform="tran slate(35,177)" onclick="goDeta il();">
    > <text font-family="Arial" font-size="10" font-weight="bold"
    > fill="##000000" >
    > click me
    > <set attributeName=" fill" attributeType=" CSS" to="##FF0000"
    > begin="mouseove r" end="mouseout"/>
    > <set attributeName=" fill" attributeType=" CSS" to="##FF0000"
    > begin="mousedow n" end="mouseup"/>
    > </text>
    > </g>
    > </svg>
    > </cfoutput>
    > <CFSETTING ENABLECFOUTPUTO NLY="No">[/color]

    In attempt to narrow down the problem I tried the same thing using PERL.

    Sadly I get the same result.

    That is:

    When the cgi script executes standalone the javascript works.

    When the cgi script is 'POSTED' to from the same CF script the
    javascript does not work.

    Mike

    Comment

    • kaeli

      #3
      Re: Klugdy CF Prevents Javascript From Executing?

      In article <40EEB30C.141E8 A0B@ram.lmtas.l mco.com>,
      hillmw@ram.lmta s.lmco.com enlightened us with...[color=blue]
      >
      > In attempt to narrow down the problem I tried the same thing using PERL.
      >[/color]

      If you really want to narrow it down, forget all the server-side stuff.
      The only thing that matters for client-side script is what the client
      sees.

      When it works, do a view source on the client doc.
      When it doesn't, do a view source on the client doc.

      See a difference?

      --
      --
      ~kaeli~
      Is it possible to be totally partial?



      Comment

      • Michael Hill

        #4
        Re: Klugdy CF Prevents Javascript From Executing?



        kaeli wrote:[color=blue]
        >
        > In article <40EEB30C.141E8 A0B@ram.lmtas.l mco.com>,
        > hillmw@ram.lmta s.lmco.com enlightened us with...[color=green]
        > >
        > > In attempt to narrow down the problem I tried the same thing using PERL.
        > >[/color]
        >
        > If you really want to narrow it down, forget all the server-side stuff.
        > The only thing that matters for client-side script is what the client
        > sees.
        >
        > When it works, do a view source on the client doc.
        > When it doesn't, do a view source on the client doc.
        >
        > See a difference?
        >[/color]

        I don't see a difference at all .....

        Comment

        • kaeli

          #5
          Re: Klugdy CF Prevents Javascript From Executing?

          In article <40EEF841.96A74 BC1@ram.lmtas.l mco.com>,
          hillmw@ram.lmta s.lmco.com enlightened us with...[color=blue][color=green]
          > >[/color]
          >
          > I don't see a difference at all .....
          >[/color]

          Okay, then post what you see here for both or post a URL so I can look.

          --
          --
          ~kaeli~
          Reading while sunbathing makes you well red.



          Comment

          • Michael Hill

            #6
            Re: Klugdy CF Prevents Javascript From Executing?

            kaeli wrote:[color=blue]
            >
            > In article <40EEF841.96A74 BC1@ram.lmtas.l mco.com>,
            > hillmw@ram.lmta s.lmco.com enlightened us with...[color=green][color=darkred]
            > > >[/color]
            > >
            > > I don't see a difference at all .....
            > >[/color]
            >
            > Okay, then post what you see here for both or post a URL so I can look.
            >[/color]

            OK there are 2 scripts here ...

            *************** *************** *************** *************** ***************
            <!--- this cf script has a link and a submit button to the same script
            both going to the same script --->
            <CFSETTING ENABLECFOUTPUTO NLY="YES">
            <cfcontent type="text/html">
            <cfoutput>
            <html>
            <head>
            <title>TEST</title>
            <script language="JavaS cript">
            function checkForm()
            {
            document.report .action="temp.c fm";
            document.report .submit();
            }
            </script>
            </head>
            <body>
            <br>
            This is a test page.
            <br><br>
            Submit the form, then when you get to temp.cfm click on "click me", you
            "will not" get a new window.
            <br><br>
            But ... if you go to temp.cfm using the link at hte bottom and click on
            "click me", you "will" get a new window.
            <hr width="100%">
            <br>Test to CF rendering as svg<br>
            <form name="report" action="" method="POST">
            Dont really have to input anything here ....
            <input type="text" name="name" value="">
            <br><br>
            You can just submit it.
            <input type="button" value=" Submit" onClick="checkF orm();">
            &nbsp;&nbsp;
            <input type="Reset" value=" Clear ">
            </form>
            <a href="http://............/temp.cfm">Or just click here to go to the
            temp page.</a>
            </body>
            </html>
            </cfoutput>
            <CFSETTING ENABLECFOUTPUTO NLY="NO">
            *************** *************** *************** *************** *************** *************
            <!--- the name of this script is temp.cfm --->
            <CFSETTING ENABLECFOUTPUTO NLY="YES">
            <cfcontent type="image/svg+xml">
            <cfoutput>
            <svg width="1024px" height="626px" onload="initsvg (evt)" viewBox="0 0
            1024 626" preserveAspectR atio="none" xmlns="http://www.w3.org/2000/svg"
            xmlns:xlink="ht tp://www.w3.org/1999/xlink">
            <title>Graphi c</title>
            <defs>
            <script language="JavaS cript">
            <![CDATA[
            var svgObj;
            function initsvg(evt)
            {
            if ( window.svgDocum ent == null )
            {
            svgDocument = evt.target.owne rDocument;
            }
            svgObj = svgDocument.doc umentElement;
            }
            function goDetail()
            {
            var myurl = "";
            var detailwin = open( myurl, "detail",
            "toolbar=no,scr ollbars=yes,wid th=600,height=5 00,dependent=no ,resizable=yes, top=50,left=50" );
            detailwin.focus ();
            }
            ]]>
            </script>
            </defs>
            <g transform="tran slate(35,177)" onclick="goDeta il();">
            <text font-family="Arial" font-size="10" font-weight="bold"
            fill="##000000" >
            click me
            <set attributeName=" fill" attributeType=" CSS" to="##FF0000"
            begin="mouseove r" end="mouseout"/>
            <set attributeName=" fill" attributeType=" CSS" to="##FF0000"
            begin="mousedow n" end="mouseup"/>
            </text>
            </g>
            </svg>
            </cfoutput>
            <CFSETTING ENABLECFOUTPUTO NLY="No">

            Comment

            • kaeli

              #7
              Re: Klugdy CF Prevents Javascript From Executing?

              In article <40F5CC78.B81B4 B1F@ram.lmtas.l mco.com>,
              hillmw@ram.lmta s.lmco.com enlightened us with...[color=blue]
              > <cfcontent type="image/svg+xml">[/color]

              Neither my NN7 nor my IE6 know how to handle this file type. I get a
              prompt about it for both.
              What should I use to test this?


              --
              --
              ~kaeli~
              If God dropped acid, would he see people?



              Comment

              • Michael Hill

                #8
                Re: Klugdy CF Prevents Javascript From Executing?

                First you have to have coldfusion installed and you need the adobe
                plugin that you can get here:



                Mike

                kaeli wrote:[color=blue]
                >
                > In article <40F5CC78.B81B4 B1F@ram.lmtas.l mco.com>,
                > hillmw@ram.lmta s.lmco.com enlightened us with...[color=green]
                > > <cfcontent type="image/svg+xml">[/color]
                >
                > Neither my NN7 nor my IE6 know how to handle this file type. I get a
                > prompt about it for both.
                > What should I use to test this?
                >
                > --
                > --
                > ~kaeli~
                > If God dropped acid, would he see people?
                > http://www.ipwebdesign.net/wildAtHeart
                > http://www.ipwebdesign.net/kaelisSpace[/color]

                Comment

                • kaeli

                  #9
                  Re: Klugdy CF Prevents Javascript From Executing?

                  In article <40F727D0.98E14 923@ram.lmtas.l mco.com>,
                  hillmw@ram.lmta s.lmco.com enlightened us with...[color=blue]
                  > First you have to have coldfusion installed and you need the adobe
                  > plugin that you can get here:
                  >
                  > http://www.adobe.com/svg/viewer/install/auto/
                  >
                  > Mike
                  >[/color]

                  Do you have to use POST for the form?

                  For some reason I have yet to determine, the script works fine both ways
                  if you submit the form with GET.

                  I'll see if I can figure out why. It has nothing to do with the actual
                  syntax of your javascript, as the script is written exactly the same,
                  the events are fired, and the functions are called no matter what the
                  method used.

                  Interestingly enough, if I fully qualify the open as window.open, I get
                  a security error of permission denied - but only after form submission
                  (get or post, either one). Click on the link and it works.

                  So this has something to do with the way things are handled with form
                  submissions. I'll poke around.

                  --
                  --
                  ~kaeli~
                  The man who fell into an upholstery machine is fully
                  recovered.



                  Comment

                  • kaeli

                    #10
                    Re: Klugdy CF Prevents Javascript From Executing?

                    In article <40F727D0.98E14 923@ram.lmtas.l mco.com>,
                    hillmw@ram.lmta s.lmco.com enlightened us with...[color=blue]
                    > First you have to have coldfusion installed and you need the adobe
                    > plugin that you can get here:
                    >
                    > http://www.adobe.com/svg/viewer/install/auto/
                    >[/color]


                    Okay, I've narrowed it down even more. It's the SVG, because when I
                    submit the form using POST to a normal CFM page, it works just fine.

                    I submitted the form to this .cfm page and everything was cool.

                    <CFSETTING ENABLECFOUTPUTO NLY="YES">
                    <cfoutput>
                    <html>
                    <head>
                    <title> New Document </title>
                    <script language="JavaS cript" type="text/javascript">
                    var svgObj;
                    function goDetail()
                    {
                    var myurl = "";
                    var detailwin = open( myurl, "detail",
                    "toolbar=no,scr ollbars=yes,wid th=600,height=
                    500,dependent=n o,resizable=yes ,top=50,left=50 ");
                    alert("detail") ;
                    detailwin.focus ();
                    }

                    </script>

                    </head>

                    <body>
                    <a href="javascrip t:goDetail()">C lick me</a>
                    </body>
                    </html>
                    </cfoutput>
                    <CFSETTING ENABLECFOUTPUTO NLY="No">

                    So, I'm sorry, I'm lost after this. I don't know jack about SVG.

                    If you can submit your form with GET, it works with the SVG. Otherwise,
                    you'll have to do more research. I'm at the end of my knowledge base
                    here.

                    Good luck.

                    --
                    --
                    ~kaeli~
                    The Bermuda Triangle got tired of warm weather. It moved to
                    Finland. Now Santa Claus is missing.



                    Comment

                    • Michael Hill

                      #11
                      Re: Klugdy CF Prevents Javascript From Executing?

                      > Okay, I've narrowed it down even more. It's the SVG, because when I[color=blue]
                      > submit the form using POST to a normal CFM page, it works just fine.
                      >
                      > I submitted the form to this .cfm page and everything was cool.
                      >
                      > <CFSETTING ENABLECFOUTPUTO NLY="YES">
                      > <cfoutput>
                      > <html>
                      > <head>
                      > <title> New Document </title>
                      > <script language="JavaS cript" type="text/javascript">
                      > var svgObj;
                      > function goDetail()
                      > {
                      > var myurl = "";
                      > var detailwin = open( myurl, "detail",
                      > "toolbar=no,scr ollbars=yes,wid th=600,height=
                      > 500,dependent=n o,resizable=yes ,top=50,left=50 ");
                      > alert("detail") ;
                      > detailwin.focus ();
                      > }
                      >
                      > </script>
                      >
                      > </head>
                      >
                      > <body>
                      > <a href="javascrip t:goDetail()">C lick me</a>
                      > </body>
                      > </html>
                      > </cfoutput>
                      > <CFSETTING ENABLECFOUTPUTO NLY="No">
                      >
                      > So, I'm sorry, I'm lost after this. I don't know jack about SVG.
                      >
                      > If you can submit your form with GET, it works with the SVG. Otherwise,
                      > you'll have to do more research. I'm at the end of my knowledge base
                      > here.
                      >
                      > Good luck.
                      >[/color]

                      Crap-o-la ... I am glad somebody sees what I am seeing ... Praise the
                      Lord.

                      I appreciate the time you spent on this. I'd like to use get, but there
                      is just too much information to try to pack in the url.

                      So, you think it is a SVG thing? I guess I'll contact adobe then.

                      Mike

                      Comment

                      • kaeli

                        #12
                        Re: Klugdy CF Prevents Javascript From Executing?

                        In article <40F7FFE3.5F4F2 EB6@ram.lmtas.l mco.com>,
                        hillmw@ram.lmta s.lmco.com enlightened us with...

                        I think I got it...
                        I don't know if it will help you, but read on...
                        [color=blue][color=green]
                        > >[/color]
                        >
                        > Crap-o-la ... I am glad somebody sees what I am seeing ... Praise the
                        > Lord.
                        >[/color]

                        *LOL*
                        [color=blue]
                        > I appreciate the time you spent on this. I'd like to use get, but there
                        > is just too much information to try to pack in the url.
                        >[/color]

                        Ah, gotcha.
                        [color=blue]
                        > So, you think it is a SVG thing? I guess I'll contact adobe then.[/color]

                        Well, since it worked without it and didn't work with it and only didn't
                        work when the form was POSTed, I'd say so, yeah. I'd be of the opinion
                        that it is a bug, personally.

                        Looking around at

                        I see two things that jump out at me.
                        There is no open method. Which hints to me that the open method is NOT
                        part of Adobe's SVG internal javascript engine.
                        Now I see a browserEval method...

                        HEY!!
                        Check this out.

                        It WORKED for me using that method instead!

                        <CFSETTING ENABLECFOUTPUTO NLY="YES">
                        <cfcontent type="image/svg+xml">
                        <cfoutput>
                        <svg width="1024px" height="626px" onload="initsvg (evt)" viewBox="0 0
                        1024 626" preserveAspectR atio="none" xmlns="http://www.w3.org/2000/svg"
                        xmlns:xlink="ht tp://www.w3.org/1999/xlink">
                        <title>Graphi c</title>
                        <defs>
                        <script language="JavaS cript" type="text/javascript">
                        <![CDATA[
                        var svgObj;
                        function initsvg(evt)
                        {
                        if ( window.svgDocum ent == null )
                        {
                        svgDocument = evt.target.owne rDocument;
                        }
                        svgObj = svgDocument.doc umentElement;

                        }
                        function goDetail()
                        {

                        var myurl = "";
                        browserEval("op en( '', 'detail',
                        'toolbar=no,scr ollbars=yes,wid th=600,height=
                        500,dependent=n o,resizable=yes ,top=50,left=50 ')");
                        }

                        ]]>
                        </script>
                        </defs>
                        <g transform="tran slate(35,177)" onclick="goDeta il();">

                        <text font-family="Arial" font-size="10" font-
                        weight="bold" fill="##000000" >
                        click me
                        <set attributeName=" fill" attributeType=" CSS"
                        to="##FF0000" begin="mouseove r" end="mouseout"/>
                        <set attributeName=" fill" attributeType=" CSS"
                        to="##FF0000" begin="mousedow n" end="mouseup"/>
                        </text>
                        </g>
                        </svg>
                        </cfoutput>
                        <CFSETTING ENABLECFOUTPUTO NLY="No">

                        Give it a shot.

                        On an interesting note, I found this stuff on bug lists. You might be
                        interested.

                        -----------------------------------------------------------

                        Peter Sorotokin on Mozilla bug 133567:

                        "This bug and all related bugs were fixed in Adobe SVG Viewer v6
                        Preview Release (Windows only at the moment, but keep looking
                        www.adobe.com/svg/viewer/install/beta.html). We no longer try to support
                        Mozilla browser scripting."

                        -----------------------------------------------------------

                        Other viewers:

                        https://www.w3.org/Graphics/SVG/SVG-...ns.htm8#viewer,
                        https://www.protocol7.com/svg-wiki/o...mplementations.

                        -----------------------------------------------------------

                        Adobe SVG bug report submission:


                        --
                        --
                        ~kaeli~
                        Why do people who know the least know it the loudest?



                        Comment

                        • Michael Hill

                          #13
                          Re: Klugdy CF Prevents Javascript From Executing?

                          [color=blue]
                          > function goDetail()
                          > {
                          >
                          > var myurl = "";
                          > browserEval("op en( '', 'detail',
                          > 'toolbar=no,scr ollbars=yes,wid th=600,height=
                          > 500,dependent=n o,resizable=yes ,top=50,left=50 ')");
                          > }[/color]

                          That Works !!!!!!

                          browserEval() .....

                          Thank you very much ....

                          Mike

                          Comment

                          • kaeli

                            #14
                            Re: Klugdy CF Prevents Javascript From Executing?

                            In article <40F8310E.6BA67 22B@ram.lmtas.l mco.com>,
                            hillmw@ram.lmta s.lmco.com enlightened us with...[color=blue]
                            >
                            > That Works !!!!!!
                            >
                            > browserEval() .....
                            >
                            > Thank you very much ....
                            >
                            > Mike
                            >[/color]

                            You're welcome.
                            Glad it did the trick.

                            --
                            --
                            ~kaeli~
                            Never say, "Oops!"; always say, "Ah, interesting!"



                            Comment

                            • Michael Hill

                              #15
                              Re: Klugdy CF Prevents Javascript From Executing?



                              kaeli wrote:[color=blue]
                              >
                              > In article <40F8310E.6BA67 22B@ram.lmtas.l mco.com>,
                              > hillmw@ram.lmta s.lmco.com enlightened us with...[color=green]
                              > >
                              > > That Works !!!!!!
                              > >
                              > > browserEval() .....
                              > >
                              > > Thank you very much ....
                              > >
                              > > Mike
                              > >[/color]
                              >
                              > You're welcome.
                              > Glad it did the trick.
                              >[/color]

                              As a side effect it put the url that I want to execute in the url of the
                              main window. So you have to hit the back button twice to get to the
                              original screen you came from.

                              Do you see where I am coming from?

                              Mike

                              Comment

                              Working...