Skip to main content
Inspiring
July 24, 2008
Question

the Javascript Question?>

  • July 24, 2008
  • 1 reply
  • 245 views
I am just trying to create a feature when i get an error from the page like:

abc.cfm?error="blahsgdhajhasdasdghafdhgasfhgafdhgasfdhgasfd"
i was trying that the error should appear on the body onload event through javascript.

I tried something but i did not came accross it.

This was the code i am trying.

<cfscript>
function a()
{
var error = '#url.error#';
}
</cfscript>
<cfoutput>
<body onload="return alert('#error#');"></body>
</cfoutput>

It will be new thing for me if this gets work.
This topic has been closed for replies.

1 reply

Inspiring
July 24, 2008
cfscript does not write js. use the script tag if that's what you're trying to do.

Wouldn't it be easier to forget the script altogether and add the url scope to the variable in the body tag?