function recuperarFactByToken(token) { var protocol = location.protocol; var host = location.host; var contextPath='<%=request.getContextPath()%>'; //var path = protocol + "//" + host + contextPath + "/getPDF/" + token + ".html"; let docActual = (""+document.getElementById(token).cells[0].title).split("-");//'FA-440-A-1367092' let sucursal = docActual[1]; let numero = docActual[3]; alert(docActual); let newUrl = "http://test.realsoftware.com.ar/rs_fe/wko/rece_caea/"+ "impresion_remota.php?account=30696170580&tipocomprobante=1&sucursal=440"+ "&numero=1535589&clave=13d34270b84aa5331cc7279dbc3cc786"; let newUrl2 = "http://test.realsoftware.com.ar/rs_fe/wko/rece_caea/"+ "impresion_remota.php?account=30696170580&tipocomprobante=1&sucursal="+sucursal+ "&numero="+numero+"&clave=13d34270b84aa5331cc7279dbc3cc786"; window.open(newUrl); }