Consider the following:
<!-------- page.cfm -------->
<cfwindow name="myWindow" source="content.cfm" />
<input type="button" onClick="ColdFusion.Window.show('myWindow')" value="Show the Window">
<!-------- End page.cfm -------->
And the following content page, called by page.cfm
<!-------- content.cfm -------->When page.cfm tells the cfwindow to load conten.cfm, here is the HTML that will be sent to the browser for content.cfm
<script>
function tellMeSomething (somethingToTell) {
alert('somethingToTell');
}
</script>
<input type="button" onClick=" tellMeSomething('yadda-yadda-yadda'); " value="Tell me Something.">
<!-------- End content.cfm -------->
<div style="overflow: auto; height: 253px; width: 474px;" id="myWindow_body" class="x-dlg-bd">Notice that the <script tag and its associated function was completely stripped out.
<input onclick=" tellMeSomething('yadda-yadda-yadda'); " type="button" value="Tell me Something.">
</div>
Obviously, this is a problem if the page that you are loading needs to call a JavaScript function. There is a workaround, albeit a very imperfect one. If you put your JavaScript in the calling page (i.e. in the example above, you would put it in page.cfm), it will work.
The problem with the above workaround is that it encourages poor programming practices, and very high coupling between page.cfm and content.cfm.