Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IntraWeb 15.3.x JavaScript code generation issue
#3
Thank you for the suggestion, but the fact remains that the code in procedure TIWPageContext40.AddToJavaScriptOnce(const ACode: string); has an condition to check if the JavaScript code you want to add is not already present (the comment is mine).
Code:
  if Pos(LCode, FJavaScript) <= 0 then begin // prevent LCode to be added to FJavaScript more than once?
    FJavaScript := FJavaScript + LCode;
end;

And inside procedure TIWPageContext40.FinalizeContext; is a last line as follows:
Code:
  AddToJavaScriptOnce('  return true;' + EOL + '}' + EOL);
end;

which means that I must now ensure that there is no snippet of JavaScript equal to
Code:
'  return true;' + EOL + '}' + EOL
in the FJavaScript before the FinalizeContext is called.

Which means that for example
Code:
if (event.keyCode != 13) {
  return true;
}
else
{
  IWBUTTON_BUSCAIWCL.click();
  return false;
};
would also break the IntraWeb application.

I'm sorry, but I do not believe it's feasible to ask IntraWeb developers to never add the snippet containing "  return true;EOL}EOL" using AddToJavaScriptOnce to prevent procedure TIWPageContext40.FinalizeContext from breaking.

Groetjes, Bob Swart
Reply


Messages In This Thread
RE: IntraWeb 15.3.x JavaScript code generation issue - by ebob42 - 05-03-2023, 04:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)