Copy link to clipboard
Copied
When I create a page like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<cfajaxproxy cfc="cfd_file" jsclassname="cfc">
and look at the source that is generated, I find that the cfajaxproxy code is placed before the DOCTYPE which is causing problems in how the page is being displayed. If i take the generated code and place it after th doctype, the page displays fine. Is there a way to force CF to place the cfajaxproxy code after the DOCTYPE?
Copy link to clipboard
Copied
Provide more of a proper HTML document.
The following worked fine for me.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Ajax Test</title>
<cfajaxproxy cfc="cfd_file" jsclassname="cfc">
</head>
<body>
<h1>Hello</h1>
</body>
I suspect that ColdFusion is looking for the <head>...</head> node to know where to put the JavaScript, but have no proof of that.
Message was edited by: Ian Skinner Removed <cfsavecontent...> tags unnecessary leftovers from earlier idea.
Copy link to clipboard
Copied
It seems the <head> tag was missing from the page and that fixed the issue. thanks.
Copy link to clipboard
Copied
missing <head> tag