Description
Discovered via TCK: commandScript - spec613.xhtml
https://github.com/jakartaee/faces/blob/7d3edf6fd066b340746040460b63a79cc26aff3e/tck/faces23/commandScript/src/main/webapp/spec613.xhtml
JavaScript Error:
Uncaught TypeError: myfaces._impl is undefined
Generated HTML code:
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Spec613IT - commandScript</title> </head> <body> <form id="j_id_7" name="j_id_7" method="post" action="/commandScript/spec613.xhtml" enctype="application/x-www-form-urlencoded"> <script src="/commandScript/jakarta.faces.resource/faces.js.xhtml?ln=jakarta.faces"></script> <span id="j_id_7:j_id_8"> <script>var foo = function(o){var o=(typeof o==='object')&&o?o:{};myfaces.ab('j_id_7:j_id_8',null,'action','','result')};myfaces._impl.core._Runtime.addOnLoad(window,foo);</script> </span> <span id="j_id_7:j_id_9"> <script>var bar = function(o){var o=(typeof o==='object')&&o?o:{};myfaces.ab('j_id_7:j_id_9',null,'action','','result')}</script> </span> <input type="hidden" name="j_id_7_SUBMIT" value="1" /><input type="hidden" name="jakarta.faces.ViewState" id="j_id__v_0:jakarta.faces.ViewState:1" value="YTA0OTg5YWVkZTU2NDE2YTAwMDAwMDAx" autocomplete="off" /> </form> <span id="result"></span> </body> </html>
Old scripts had a onload function, but I don't see anything like that in the new scripts:
this.addOnLoad = function(target, func) {
var oldonload = (target) ? target.onload : null;
target.onload = (!oldonload) ? func : function() {
try
catch (e)
{ throw e; }finally
{ func(); } };
};