0

I have used document.createEvent() to create event in javaScript in my application. I have IE11 on my machine. I have tested the application on my local, and code is working fine, and then I have deployed code change to DEV environment and tested the same on same browser and it's working over there as well. However, when I deployed my application on QC environment, I observed that it was throwing an exception in browser console. So, in QC environment this change is not working.

I have changed to window.event and then it's working on all the environments.

We have struts based application, deployed on WebSphere app server.

Does anyone have idea why this issue happened? are there any configurations on app server which can cause this issue?

Thanks,

Jay Patel

dbreaux
  • 4,982
  • 1
  • 25
  • 64
Jay Patel
  • 523
  • 2
  • 15
  • 26
  • This is a potential X/Y problem. You ask about the event. Why not ask about what you are trying to DO with the event. Perhaps we have a better solution – mplungjan Aug 25 '16 at 13:39
  • Actually, we have built-in format function which formats the 10 digit number into US phone number format. This format function is getting called on keypress and keydown event and event is getting passed with format function. like onkeypress = "format(this, this.value, event)". Now, I want to call this function on page load. So, while calling format function from javascript function I have to pass event object. So, I have written it in such a way. – Jay Patel Aug 25 '16 at 14:11
  • If you show the function we can likely rewrite it without the event. Also why pass this.value when you pass this – mplungjan Aug 25 '16 at 14:21
  • @mplungjan: Actually, it's ancient code, used at thousand places. I can't get rid of this, even jQuery is not supported by my application :). So, I can simply use this. I am coming to my question, why this issue came do you have any idea? actually it should be worked on all environment, but didn't worked for QC. So, that is harassing me as I will have to explain it to my seniors and I don't have any clue. – Jay Patel Aug 25 '16 at 14:26

1 Answers1

1

This is a client-side behavior only, unrelated to WebSphere or Struts.

It sounds exactly like it's caused by IE choosing different "Compatibility Mode" settings for the different server environments you're connecting to. We've hit this ourselves because one of our environments is in our company's domain, while our other environments are in our customer's domain. e.g. dev.mycompany.com vs. test.customer.com.

IE uses a number of criteria to determine whether to render in "Compatibility Mode" vs "Standards Mode", including a Compatibility view list that is checked for specific domains, and whether or not a site is in your "Trusted Sites" group.

So I'd check your Trusted Sites for one or both of your environments, check Microsoft's lists (above link), potentially add or remove the appropriate domains from your local IE settings (e.g. as described in Fix site display issues with Compatibility view), or maybe be able to add headers to your HTML that will explicitly tell IE to use a certain mode.

You can also check which Zone the site belongs to via the IE File > Properties menu.

Another relevant Q&A: https://stackoverflow.com/a/13287226

Community
  • 1
  • 1
dbreaux
  • 4,982
  • 1
  • 25
  • 64
  • 1
    Thanks, We have made QA URL to IE 11 compatible with some kind of registry settings. That's why it's not working. Thanks @dbreaux – Jay Patel Aug 26 '16 at 13:43