Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CallBackResponse not working all the times
#1
Please I need to execute some javascript commands in my project. I found that the CallBackResponse can do the job.
The issue I face is that the procedure is not working all the times.

The first example which i want to focus to a text box is working perfectly.
var
  js: string;
begin
  js := 'document.getElementById("TXTQUANTITY").focus();';
  WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA(js);
end;


but when i try to run other commands it does nothing even a simple pop message
  js:=  'windows.alert("I am an alert box!");';
  WebApplication.CallBackResponse.AddJavaScriptToExecute(js);

Is there something else I have to pay attention.

i am running XE6 and Intraweb 14.0.50 version
Reply
#2
The syntax is incorrect in the second example. The object is window (singular), not windows. You can omit window object and use alert() only too.
Reply
#3
(01-12-2020, 12:15 AM)Alexandre Machado Wrote: The syntax is incorrect in the second example. The object is window (singular), not windows. You can omit window object and use alert() only too.

I tried with alert only. It is not working. The problem is not in the syntax (it was a mistake when I wrote this post).
Reply
#4
This is the standard way of producing that output. You say that it is not working at "all times". What does it mean? Does it work sometimes? Have you checked the console log window for other JavaScript errors?
This version is also ancient (probably 7+ years old). I strongly recommend you to update it to a newer release.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)