[ https://issues.apache.org/jira/browse/MYFACES-4378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17844679#comment-17844679 ]
Werner Punz edited comment on MYFACES-4378 at 5/8/24 2:45 PM: -------------------------------------------------------------- Does not really matter, see my updated comment, the question is what the resource id field itself is which gets updated, if it is a script tag then it automatically gets evaled, but then the eval section is pointless, on the other hand if you have the eval section you wont need the embedded script doing the same. This is a "garbage" response! Btw forgot, the modern eval method for scripts is to append them to the head and clear them out again, that way the browser safely can do the eval! All 3 implementations of the scripts nowadays use this method for evaling js! Might play into this, but this is just a sidenote! {code:java} // code placeholder globalEval(code: string, nonce ?: string): DomQuery { const head = document.getElementsByTagName("head")?.[0] ?? document.documentElement.getElementsByTagName("head")?.[0]; const script = document.createElement("script"); if (nonce) { if ('undefined' != typeof script?.nonce) { script.nonce = nonce; } else { script.setAttribute("nonce", nonce); } } script.type = "text/javascript"; script.innerHTML = code; let newScriptElement = head.appendChild(script); head.removeChild(newScriptElement); return this; } {code} What happens here is at the moment the script is appended it gets evaled by the browser engine, and once evaled it is removed... was (Author: werpu): Does not really matter, see my updated comment, the question is what the resource id field itself is which gets updated, if it is a script tag then it automatically gets evaled, but then the eval section is pointless, on the other hand if you have the eval section you wont need the embedded script doing the same. This is a "garbage" response! Btw forgot, the modern eval method for scripts is to append them to the head and clear them out again, that way the browser safely can do the eval! All 3 implementations of the scripts nowadays use this method for evaling js! Might play into this, but this is just a sidenote! > onloadScript not rendering with non ajax command button if jstl type tag c:if > is present on the page > ---------------------------------------------------------------------------------------------------- > > Key: MYFACES-4378 > URL: https://issues.apache.org/jira/browse/MYFACES-4378 > Project: MyFaces Core > Issue Type: Bug > Affects Versions: 2.3.10, 2.3-next-M8, 4.0.2, 4.1.0-RC1 > Reporter: Thomas Andraschko > Assignee: Thomas Andraschko > Priority: Minor > Attachments: pf-11780.zip, test.7z > > > See https://github.com/omnifaces/omnifaces/issues/366 -- This message was sent by Atlassian Jira (v8.20.10#820010)