Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am upgrading .net 2 to .net 4.8.
documnet.getall is not working in chrome and edge. It's working in only IE.
How can I change this code?
Help me :)

var btnHiddenOK = document.getall ? document.getElementById['<%= btnHiddenOK.ClientID %>'] : document.getElementById('<%= btnHiddenForTriger.ClientID %>');

What I have tried:

var btnHiddenOK = document.getElementById("")? document.getElementById['<%= btnHiddenOK.ClientID %>'] : document.getElementById('<%= btnHiddenForTriger.ClientID %>');


It's also not working
Posted
Comments
Richard Deeming 20-Jul-22 3:32am    
Not clear. Both branches of your ternary statement use the same method - document.getElementById - with the only difference being the element you're looking for. Why are you looking at a different element in IE than in real browsers?

I suspect you've got a much larger issue in your code. If you've written it assuming that everything except IE needs workarounds, then you'll almost certainly need to rewrite it, starting with the assumption that IE is the browser that needs the workarounds.

(That's assuming you still want to support a dead browser[^] at all.)

Either way, this is an issue with your Javascript. It's nothing whatsoever to do with upgrading to a newer .NET Framework version.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900