var energy = []; var jpi = []; var Name; var A; var Sym; function breakdownName(str) { const match = str.match(/^(\d+)([a-zA-Z]+)$/); if (match) { const numberPart = parseInt(match[1]); const stringPart = match[2]; return { numberPart, stringPart }; } else { return null; // If the input string doesn't match the expected format } } var Sn = 999; var Sp = 999; var Sa = 999; function GetData(){ Name = document.getElementById('isotopes_name').value; let maxEx = parseFloat(document.getElementById('maxEx').value); console.log(maxEx); let str = 'get_nuclear_data.py?isotopes_name=' + Name + "&maxEx=" + maxEx; let client = new XMLHttpRequest(); client.onreadystatechange = function() { let haha = client.responseText.split('\n').slice(17); jpi = []; energy = []; haha.forEach(line =>{ // console.log(line); if( line.includes("Sn:") && line.length != 0 ){ Sn = line.substring(-8); } if( line.includes("