tracker issue : CF-4198240

select a category, or use search below
(searches all categories and all time range)
Title:

CFAJAXPROXY tag places generated <script> tags at bottom of <head>

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Michael Clark / Michael Clark ()

Created: 01/05/2017

Components: AJAX

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11 Update 11 / 11,0,12,302319

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 4

Problem Description:
When creating a JavaScript proxy for a CFC using the CFAJAXPROXY tag, the generated <script> tags in the HTML source are placed at the bottom of the <head>. Before CF11 Update 11, they were placed at the top of the <head>. This causes the instantiation of the proxy to fail, as the proxy object has not yet been created.

Files containing the generated HTML source code both before and after applying Update 11 are attached. 

Steps to Reproduce:
1. Create a CFC:

<cfcomponent displayname="Test">
	<cffunction name="getText" output="false" access="remote" returntype="string">
		<cfreturn "Hello" />
	</cffunction>
</cfcomponent>

2. Create a CFM page:

<!DOCTYPE html>
<html lang="en">
<head>
<cfajaxproxy cfc="src.cfc.Test" jsclassname="Test">
<script>
var cfcTest = new Test();
console.log(cfcTest.getText());
</script>
</head>
<body>
</body>
</html>

3. Execute the CFM page.

Actual Result:
In the browser console, the following is displayed:
ReferenceError: Test is not defined

Expected Result:
In the browser console, the following should be displayed:
Hello

Any Workarounds:
Rollback to CF11 Update 10

Attachments:

  1. January 05, 2017 00:00:00: post_update_11.html
  2. January 05, 2017 00:00:00: pre_update_11.html

Comments:

Happening to us on Mac and Windows. Rollback time.
Comment by JOSEPH D.
1367 | January 12, 2017 07:29:55 PM GMT
Any news on this fix? We can't apply Update 11 or beyond until this is resolved.
Comment by Michael C.
1368 | March 09, 2017 06:55:40 PM GMT