473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 ENABLECFOUTPUTONLY="YES">
<cfcontent type="image/svg+xml">
<cfoutput>
<svg width="1024px" height="626px" onload="initsvg(evt)" viewBox="0 0 1024
626" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Graphic</title>
<defs>
<script language="JavaScript">
<![CDATA[
var svgObj;
function initsvg(evt)
{
if ( window.svgDocument == null )
{
svgDocument = evt.target.ownerDocument;
}
svgObj = svgDocument.documentElement;
}
function goDetail()
{
var myurl = "";
var detailwin = open( myurl, "detail",
"toolbar=no,scrollbars=yes,width=600,height=500,de pendent=no,resizable=yes,t
op=50,left=50");
detailwin.focus();
}
]]>
</script>
</defs>
<g transform="translate(35,177)" onclick="goDetail();">
<text font-family="Arial" font-size="10" font-weight="bold"
fill="##000000">
click me
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mouseover" end="mouseout"/>
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mousedown" end="mouseup"/>
</text>
</g>
</svg>
</cfoutput>
<CFSETTING ENABLECFOUTPUTONLY="No">
Jul 23 '05 #1
15 1824


Michael Hill wrote:

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 ENABLECFOUTPUTONLY="YES">
<cfcontent type="image/svg+xml">
<cfoutput>
<svg width="1024px" height="626px" onload="initsvg(evt)" viewBox="0 0 1024
626" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Graphic</title>
<defs>
<script language="JavaScript">
<![CDATA[
var svgObj;
function initsvg(evt)
{
if ( window.svgDocument == null )
{
svgDocument = evt.target.ownerDocument;
}
svgObj = svgDocument.documentElement;
}
function goDetail()
{
var myurl = "";
var detailwin = open( myurl, "detail",
"toolbar=no,scrollbars=yes,width=600,height=500,de pendent=no,resizable=yes,t
op=50,left=50");
detailwin.focus();
}
]]>
</script>
</defs>
<g transform="translate(35,177)" onclick="goDetail();">
<text font-family="Arial" font-size="10" font-weight="bold"
fill="##000000">
click me
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mouseover" end="mouseout"/>
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mousedown" end="mouseup"/>
</text>
</g>
</svg>
</cfoutput>
<CFSETTING ENABLECFOUTPUTONLY="No">


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
Jul 23 '05 #2
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...

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


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?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3


kaeli wrote:

In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...

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


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?


I don't see a difference at all .....
Jul 23 '05 #4
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...


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


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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5
kaeli wrote:

In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...


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


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


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 ENABLECFOUTPUTONLY="YES">
<cfcontent type="text/html">
<cfoutput>
<html>
<head>
<title>TEST</title>
<script language="JavaScript">
function checkForm()
{
document.report.action="temp.cfm";
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="checkForm();">
&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 ENABLECFOUTPUTONLY="NO">
************************************************** **************************************
<!--- the name of this script is temp.cfm --->
<CFSETTING ENABLECFOUTPUTONLY="YES">
<cfcontent type="image/svg+xml">
<cfoutput>
<svg width="1024px" height="626px" onload="initsvg(evt)" viewBox="0 0
1024 626" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Graphic</title>
<defs>
<script language="JavaScript">
<![CDATA[
var svgObj;
function initsvg(evt)
{
if ( window.svgDocument == null )
{
svgDocument = evt.target.ownerDocument;
}
svgObj = svgDocument.documentElement;
}
function goDetail()
{
var myurl = "";
var detailwin = open( myurl, "detail",
"toolbar=no,scrollbars=yes,width=600,height=500,de pendent=no,resizable=yes,top=50,left=50");
detailwin.focus();
}
]]>
</script>
</defs>
<g transform="translate(35,177)" onclick="goDetail();">
<text font-family="Arial" font-size="10" font-weight="bold"
fill="##000000">
click me
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mouseover" end="mouseout"/>
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mousedown" end="mouseup"/>
</text>
</g>
</svg>
</cfoutput>
<CFSETTING ENABLECFOUTPUTONLY="No">
Jul 23 '05 #6
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...
<cfcontent type="image/svg+xml">


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

Jul 23 '05 #7
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

kaeli wrote:

In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...
<cfcontent type="image/svg+xml">


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

Jul 23 '05 #8
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...
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


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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #9
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...
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/

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 ENABLECFOUTPUTONLY="YES">
<cfoutput>
<html>
<head>
<title> New Document </title>
<script language="JavaScript" type="text/javascript">
var svgObj;
function goDetail()
{
var myurl = "";
var detailwin = open( myurl, "detail",
"toolbar=no,scrollbars=yes,width=600,height=
500,dependent=no,resizable=yes,top=50,left=50");
alert("detail");
detailwin.focus();
}

</script>

</head>

<body>
<a href="javascript:goDetail()">Click me</a>
</body>
</html>
</cfoutput>
<CFSETTING ENABLECFOUTPUTONLY="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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #10
> 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 ENABLECFOUTPUTONLY="YES">
<cfoutput>
<html>
<head>
<title> New Document </title>
<script language="JavaScript" type="text/javascript">
var svgObj;
function goDetail()
{
var myurl = "";
var detailwin = open( myurl, "detail",
"toolbar=no,scrollbars=yes,width=600,height=
500,dependent=no,resizable=yes,top=50,left=50");
alert("detail");
detailwin.focus();
}

</script>

</head>

<body>
<a href="javascript:goDetail()">Click me</a>
</body>
</html>
</cfoutput>
<CFSETTING ENABLECFOUTPUTONLY="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.


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
Jul 23 '05 #11
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...

I think I got it...
I don't know if it will help you, but read on...

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


*LOL*
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.

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


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
http://www.svg.org/wiki/index.php/AdobeSVGViewerWindow
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 ENABLECFOUTPUTONLY="YES">
<cfcontent type="image/svg+xml">
<cfoutput>
<svg width="1024px" height="626px" onload="initsvg(evt)" viewBox="0 0
1024 626" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Graphic</title>
<defs>
<script language="JavaScript" type="text/javascript">
<![CDATA[
var svgObj;
function initsvg(evt)
{
if ( window.svgDocument == null )
{
svgDocument = evt.target.ownerDocument;
}
svgObj = svgDocument.documentElement;

}
function goDetail()
{

var myurl = "";
browserEval("open( '', 'detail',
'toolbar=no,scrollbars=yes,width=600,height=
500,dependent=no,resizable=yes,top=50,left=50')");
}

]]>
</script>
</defs>
<g transform="translate(35,177)" onclick="goDetail();">

<text font-family="Arial" font-size="10" font-
weight="bold" fill="##000000">
click me
<set attributeName="fill" attributeType="CSS"
to="##FF0000" begin="mouseover" end="mouseout"/>
<set attributeName="fill" attributeType="CSS"
to="##FF0000" begin="mousedown" end="mouseup"/>
</text>
</g>
</svg>
</cfoutput>
<CFSETTING ENABLECFOUTPUTONLY="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:

http://www.w3.org/Graphics/SVG/SVG-I...ns.htm8#viewer,
http://www.protocol7.com/svg-wiki/ow...mplementations.

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

Adobe SVG bug report submission:
http://www.adobe.com/svg/feedback/bugreport.html

--
--
~kaeli~
Why do people who know the least know it the loudest?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #12
function goDetail()
{

var myurl = "";
browserEval("open( '', 'detail',
'toolbar=no,scrollbars=yes,width=600,height=
500,dependent=no,resizable=yes,top=50,left=50')");
}


That Works !!!!!!

browserEval() .....

Thank you very much ....

Mike
Jul 23 '05 #13
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...

That Works !!!!!!

browserEval() .....

Thank you very much ....

Mike


You're welcome.
Glad it did the trick.

--
--
~kaeli~
Never say, "Oops!"; always say, "Ah, interesting!"
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #14


kaeli wrote:

In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...

That Works !!!!!!

browserEval() .....

Thank you very much ....

Mike


You're welcome.
Glad it did the trick.


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
Jul 23 '05 #15
In article <40***************@ram.lmtas.lmco.com>,
hi****@ram.lmtas.lmco.com enlightened us with...


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?


Yup.
This fixes it.

browserEval("open( '', 'detail',
'toolbar=no,scrollbars=yes,width=600,height=
500,dependent=no,resizable=yes,top=50,left=50');hi story.go(-1);");

--
--
~kaeli~
Can you be a closet claustrophobic?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
If I assign Java variable a to javascript variable x, it is fine. <% int a = 10; %> var x = <%= a %>; alert(x); But if I do the other way around, then it has 500 error. any ideas??
7
by: harish.mallipeddi | last post by:
Hi all, This might sound a bit weird but anyways here I go. Recently after witnessing the popularity of AJAX/DHTML, and after enjoying Gmail's fairly cool UI, I'm left wondering...is there going...
10
by: Edwin Knoppert | last post by:
I have an asp.net imagebutton with a clickevent. I have enclosed an anchor around the image and a small text. If i click the image the event is executed (while the href of the anchor shows in the...
15
by: rage3324 | last post by:
I am posting html onto my main page between div tags using xmlhttprequest and innerhtml. The html I am posting has javascript inside which I am executing using the eval() function. However, the...
2
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
I am executing an AJAX page method that is a long running task. After starting the first method, I execute a second page method to retrieve the status of the task. It works fine in an empty web...
2
by: Mic | last post by:
Hi, How can I hide a button before executing a javascript function and make it visible again after execution of the javascript function? What I need to do is: VB Page_Load: 1) Hide...
7
by: robin1983 | last post by:
Hi, good morning everyone, i have a file called attendence.php The problem is that some part of code is executing properly and half of the code is not and i dont get any warning or error message. For...
0
by: sree83 | last post by:
i am learning the c#. i want to know how can i ensure that a method get executed in atomic manner. I read about lock and ....both prevents multiple threads from accessing a code concurrently. ...
0
Frinavale
by: Frinavale | last post by:
I have a peculiar problem... Background: I have a function that I don't want the user to execute more than once while they are waiting for it to process; therefore, I disable all of the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.