Click here to Skip to main content
15,400,390 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This event runs in Internet Explorer, but not in MS Edge/Chrome. I edited some minor errors in the code, hopefully it clears up some confusion. Thanks for the links on tools to help, however, I am not allowed to download/use such tools unless they are approved by security...

Form 'C' Button event calls function in a Det.js file, which performs
calculations for the deduction and then fills in the input box next to it.

function CalcF2A() {
F2Awin = window.open("F2A.asp", "F2A", "width=500,height=450,top=300,left=200");
}

Which runs code in the F2A.asp file, aka popup, after close popup
button is clicked.


function F2Acont() {
// child is calling the parent...
try {
window.opener.CalcF2Acont();
}
catch (err) {

alert(err.description || err)

TypeError:
Cannot read properties of
undefined(reading 'FatherIncomeTotalGross')

}

}
//End -->;



//Back to the parent file Det.js file:
function CalcF2Acont() {

// doesn't make it here after exception is displayed.
alert("CalcF2Acont() cALLED?")

F2Awin.close(); //popup doesn't close.

// fetch the amount in the input, could this be the exception?
var MS = document.fidCSW.FatherIncomeTotalGross.value;

}
//form name='fnCSW' id='fidCSW'

Is it trying to read the value of the input?
Is the code correct for the textbox, something missing?
"
< input readonly
class="father blankIfMedianNetUsed blankIfParentFcOrNnr"
type='text'
name='FatherIncomeTotalGross'
value= '<%= fatherIncomeTotalGross %>';
>
"

What I have tried:

UPdated May 24.
I am out of my league here, If anyone can help, it would be great!! I am fixing bugs on IE to Edge/Chrome bugs and it's been twenty years since I looked at a javascript.
This is a legacy ASP vbScript/javasript website that has some issues running in MS Edge/Chrome. I was able to add try/catch to find the bug, I still don't know why it is happening in Edge. This is a good example of really bad coding, which may or may not be the issue. I have tried using alert() try/catch around different lines and it appears not to work after the exception. Thank for the links, after reading I did test this in MS Edge IE mode and it does work correctly. Still will not work for Chrome.
Posted
Updated 24-May-22 4:10am
v3
Comments
Richard Deeming 19-May-22 6:25am
   
// doesn't make it here after exception is displayed. 

What exception? If you want someone to help you fix an error in your code, you need to provide proper details of that error.

1 solution

This is a good example of cross-browser incompatibilities! It also depends on which version of Edge you are using - the newer version is based on Chromium unlike the older version which essentially was just an updated IE. Neither have survived the Windows 11 upgrade.

Hopefully the following will help
How to solve Javascript Browser Compatibility issues | BrowserStack[^]
As you are using IE you obviously haven't got to Windows 11 yet, but note this also How to use Internet Explorer mode in the Microsoft Edge browser for Windows 11 | My Computer My Way[^]
   
Comments
   
Thanks Chill60, learned quite alot of usefull information after reading some of the articles and related...send more if you have them.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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