I have a function where I use a js-file. In this JS-file there is a variable named err2, which I want to use in the function. How do I get this value?
The JS-file goes hereCode:function tempValues() { var luftf1 = document.cond.luftf.value; var flow1 = parent.frames[1].navform.flow.value; var retur1 = parent.frames[1].navform.retur.value; var jordt1 = parent.frames[1].navform.jordt.value; var afst1 = parent.frames[1].navform.afst.value; var jordd1 = parent.frames[1].navform.jordd.value; temp_values(); var err1 = 0; if (document.cond.system.value == "true" || document.cond.rortype.value == "false") { alert("Beregning af kondens kan kun udføres på enkeltrør til frie systemer."); window.parent.frames("right").location = "about:"; err1 = 1; } var err3 = 0; if (isNaN(luftf1) || isNaN(flow1) || isNaN(retur1) || isNaN(jordt1) || isNaN(afst1) || isNaN(jordd1)) { alert("Indtast venligst en numerisk værdi."); err3 = 1; } if ((err2 == 0) && (err1 == 0) && (err3 == 0)) { return true; } else { window.parent.frames("right").location = "about:"; return false; } }
Code:function temp_values() { var err2 = 0; /* Værdier for St. 37 */ if (parent.frames[1].navform.mat.options[mat].text == "St. 37.0 BW") { if (flow1*1 > 140 || flow1*1 < -60) { alert("Temperaturområdet for St. 37 er -60°C - 140°C."); window.parent.frames("right").location = "about:"; err2 = 1; } } /* Værdier for St. 35 */ if (parent.frames[1].navform.mat.options[mat].text == "St. 35.8 I") { if (flow1*1 > 140 || flow1*1 < -60) { alert("Temperaturområdet for St. 35 er -60°C - 140°C."); window.parent.frames("right").location = "about:"; err2 = 1; } } /* Værdier for Pex */ if (parent.frames[1].navform.mat.options[mat].text == "LR-Pex") { if (flow1*1 > 95 || flow1*1 < -60) { alert("Temperaturområdet for LR-Pex er -60°C - 95°C."); window.parent.frames("right").location = "about:"; err2 = 1; } } /* Værdier for Cu-Flex */ if (parent.frames[1].navform.mat.options[mat].text == "Cu-Flex") { if (flow1*1 > 130 || flow1*1 < -60) { alert("Temperaturområdet for Cu-Flex er -60°C - 130°C."); window.parent.frames("right").location = "about:"; err2 = 1; } } /* Værdier for Steel-Flex */ if (parent.frames[1].navform.mat.options[mat].text == "Steel-Flex") { if (flow1*1 > 130 || flow1*1 < -60) { alert("Temperaturområdet for Steel-Flex 35 er -60°C - 130°C."); window.parent.frames("right").location = "about:"; err2 = 1; } } /* Værdier for AISI */ if (parent.frames[1].navform.mat.options[mat].text == "AISI 316L") { if (flow1*1 > 140 || flow1*1 < -60) { alert("Temperaturområdet for AISI 316L er -60°C - 140°C."); window.parent.frames("right").location = "about:"; err2 = 1; } } }




Reply With Quote