ColdFusion 2016 update 11 IE Javascript problems

July 25, 2019
Newbie 1 posts
Followers: 0 people
10

ColdFusion 2016 update 11 IE Javascript problems

Newbie 1 posts
Followers: 0 people
July 25, 2019

On Windows Server 2016, using IIS, we updated ColdFusion 2016 from update 7 to update 11.  Using Internet Explorer 11, any use of AJAX (and sometimes just javascript without AJAX) caused a problem.  Chrome worked as expected for the most part, but some forms did not work.  We had to revert back to a snapshot with update 7 and then Internet Explorer and Chrome worked as expected.  Did not see any problems in the update log, everything said it was successful.

Here’s an example of the type of problem we encountered (shown in IE debug console):

SCRIPT5007: Unable to get property ‘subscribe’ of undefined or null reference (line 16, col 4)

(line 16, col 4)    _cf_autosuggest.containerCollapseEvent.subscribe(ColdFusion.Autosuggest.triggerOnChange);

We thought it might be related to the problems mentioned in update 8, but supposedly that was addressed in update 9.

Reference: https://www.petefreitag.com/item/858.cfm, ColdFusion 2016 Update 8 breaks ColdFusion.Ajax.submitForm in IE 11

It looks like cfajax.js changed between update 7 and update 11, could that be the cause of these problems?  Any ideas?  Thanks!

Comments (10)
2019-07-31 00:26:02
2019-07-31 00:26:02

So you’re saying the autosuggest works (type ahead) and the conflict is only with ajax. That’s indeed odd.

I saw you said to Kumar that the problem only happens with complex apps. Are they perhaps pulling in js libraries that may be conflicting with cf’s yui lib?

Like
(1)
>
Charlie Arehart
's comment
2019-08-02 23:36:58
2019-08-02 23:36:58
>
Charlie Arehart
's comment

Good idea, but I can’t find evidence of that.

I did find that when I replace cfajax.js from update 7 with update 11, I do not have this problem, so it is definitely related to AJAX.  At least there is a workaround, although I’m not sure what other effects this might have.

Like
2019-07-29 14:15:49
2019-07-29 14:15:49

Hi aliciam29605858,

Can you please share the sample code snippet to me at mukumar@adobe.com for which are you facing the issue?

Thanks,

Mukesh

Like
(2)
>
Kumar Mukesh
's comment
2019-07-30 20:03:28
2019-07-30 20:03:28
>
Kumar Mukesh
's comment

Hi Kumar,

Unfortunately our code is proprietary, so I can’t share it.  I’m trying to reduce it to a simple example, but so far only a more complicated example will reproduce it.  Thanks.

Like
>
Kumar Mukesh
's comment
2019-08-05 23:55:06
2019-08-05 23:55:06
>
Kumar Mukesh
's comment

I’ve emailed you example code.  It seems to be the combination of ‘cflayoutarea’ and ‘cfinput’ with ‘autosuggest’ that is causing the problem.  Interestingly, I can switch the cflayoutarea ordering so that the cfinput is the first tab, and I don’t have the problem.  Unfortunately that is not a workaround for our application.

Like
2019-07-26 21:19:06
2019-07-26 21:19:06

I realize you may be hoping someone may confirm “the problem was caused by x, and you need to change y”, but it may not be that simple.

While awaiting that, have you tried using your browser’s developer tools, to see if there are failures of any requests to obtain files from the server  (as specified by your code or by CF), when the page loads?

If you’re unfamiliar, use the f12 button in IE (or ctrl-shift-i in other browsers), or you can right-click on white space of your page and choose “inspect” or “inspect element”? When that toolset opens, go to the “network” tab in the tools. Then in IE click the green “play”icon.

Then refresh your page, observing all the files that get loaded on the request of the page. Notice how there is a status code column. See if any have 404 or other error status codes, which would indicate that they are failing to be obtained from the server.

Then right-click on any, and choose “open in new tab”, to see what happens when you visit the page directly. Maybe there will be an error giving you a clue. Or let us know what you find.

Like
(1)
(4)
>
Charlie Arehart
's comment
2019-07-30 20:24:07
2019-07-30 20:24:07
>
Charlie Arehart
's comment

Hi Charlie,

Thanks for the response.  There are no failures of any requests or when the page loads according to the browser’s developer console and the network tab.  The only failure I see is SCRIPT5007 error in the developer console, ‘eval code’, on this line, suggesting that containerCollapseEvent is null:

_cf_autosuggest.containerCollapseEvent.subscribe(ColdFusion.Autosuggest.triggerOnChange);

Here’s a version of the ‘eval code’ where identifying information is removed (the list of ‘something1,something2’ is about 80 items long).

/* <![CDATA[ */
var _cf_autosuggest_init_123456789012345=function()
{
var _cf_autosuggestarray=[];
_cf_autosuggestarray=”something1,something2,something3″.split(“,”);
var _cf_autosuggestdatasource= ColdFusion.Autosuggest.initJS_ARRAY( _cf_autosuggestarray);
_cf_autosuggestdatasource.queryMatchContains =false;
var _cf_autosuggest= ColdFusion.Autosuggest.init( ‘requestor’,’requestorcontainer’,_cf_autosuggestdatasource);
_cf_autosuggest.onbinderror=null;
_cf_autosuggest.queryMatchContains =false;
_cf_autosuggest.prehighlightClassName = “yui-ac-prehighlight”;
_cf_autosuggest.typeAhead = false;
_cf_autosuggest.maxResultsDisplayed = 10;
_cf_autosuggest.useShadow = true;
_cf_autosuggest.showloadingicon = true;
_cf_autosuggest.containerCollapseEvent.subscribe(ColdFusion.Autosuggest.triggerOnChange);
_cf_autosuggest.id=’requestor’
ColdFusion.objectCache[“requestor”] = _cf_autosuggest;
document.getElementById(“requestorcontainer”).style.left = document.getElementById(“requestor”).offsetLeft;
};ColdFusion.Event.registerOnLoad(_cf_autosuggest_init_123456789012345,{_cf_containerId:’cf_layoutareatabsomething’});
/* ]]> */

Currently we have a test server set up with update 11 and our production servers with update 7.  The autogenerated code from IE 11 that I posted above looks identical between the servers, leading me to think a change in one of the .js files from update 11 is causing the problem.

If you can think of anything else I can look at to try and narrow down the problem, please let me know.  Thanks!

Like
>
Charlie Arehart
's comment
2019-07-30 20:26:29
2019-07-30 20:26:29
>
Charlie Arehart
's comment

And I forgot to add, if I visit the page directly, it looks as expected.

Like
>
aliciam29605858
's comment
2019-07-30 21:15:37
2019-07-30 21:15:37
>
aliciam29605858
's comment

Ok. My next suggestion would be to see if adding the site to the IE  “trusted sites” feature might make a difference. I realize you may feel that it “worked before” without it, but let us know if it helps. That could be a clue, if not a solution.

Like
>
Charlie Arehart
's comment
2019-07-30 22:59:04
2019-07-30 22:59:04
>
Charlie Arehart
's comment

Thanks for the suggestion, unfortunately it did not work.  However, it did stop on a breakpoint and it turns out this is using yui (YAHOO.widget.AutoComplete) and examining the object does show the containerCollapseEvent is null.  I know yui was deprecated a few versions ago, but it has continued to work until now.

For some reason, a small test does work with <cfinput …etc… autosuggest=”#valueList(query.field)#”>, so something in combination with the autosuggest/autocomplete and other javascript/AJAX must be causing the problem.

Like
Add your comment