Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Want simple JS demo
#21
The demo Jose created works. It doesn't show anything because it is not supposed to show anything.

It sets the IWEdit1 value with the timezone offset, just like you asked.

It works fine with Http.sys, Indy or ISAPI, doesn't matter. I'm using latest version 15.1.3, so I don't see actually what's your issue here.


Here is an updated demo, as an Indy SA server, showing exactly how to call an server function from custom JavaScript.


Attached Files
.zip   Kristy.zip (Size: 52.39 KB / Downloads: 2)
Reply
#22
Thanks Alexandre, it's work now.
I add comment for it.
(Hope this forum support monospaced font)
--------------------------------------------
implementation

{$R *.dfm}
var user_TZOS : string; // for global used

procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
  HIDDEN_TZOS_EDIT.Text := 'No Changed';
  user_TZOS            := 'No Changed';

// On Create, run the javascript and DISPLAY UnControllable ajax value to EDIT field (Its not real value in EDIT.TEXT)
// (The FIELD NAME must all Upper case characters)
  Self.JavaScript.Add('document.addEventListener("DOMContentLoaded", function() {' + sLineBreak +
  'var d = new Date();' + sLineBreak +
  'var tn = d.getTimezoneOffset();' + sLineBreak +
  'document.getElementById("HIDDEN_TZOS_EDIT").value = tn;' + sLineBreak +
  '});');

// Make an event call to FIRE 'AJAX_Func' function, by Pre-Defined Tstrings(use of Javascript) "timeZoneOffset" variable
  IWButton1.ScriptEvents.HookEvent('onclick', 'ajaxCall("AJAX_Func", "timeZoneOffset=" + IW.$("HIDDEN_TZOS_EDIT").value);');

// Registed ajax function and define Converting Procedure
  WebApplication.RegisterCallBack('AJAX_Func', procedure (aParams: TStrings)
                                                  begin
                                                    // Let the EDIT.TEXT display value to be real controllable
                                                    HIDDEN_TZOS_EDIT.Text := aParams.Values['timeZoneOffset'];
                                                    user_TZOS := aParams.Values['timeZoneOffset'];
                                                  end);
end;

procedure TIWForm1.IWButton2AsyncClick(Sender: TObject; EventParams: TStringList);
begin
  Webapplication.ShowMessage('HIDDEN_TZOS_EDIT : ' + HIDDEN_TZOS_EDIT.Text);
  Webapplication.ShowMessage('Global variable user_TZOS : ' + user_TZOS);
end;


-----------------------------------------------

More ! For remark...

HTTP.sys isn't compatible with the ASP.NET Core Module and can't be used with IIS or IIS Express.
https://docs.microsoft.com/en-us/aspnet/...etcore-2.2

Hope no need to touch that
https://support.microsoft.com/en-us/help...or-windows

(My IIS uninstallation may be not clear enough, still finding out how)
Reply
#23
The document you posted regarding ASP.NET is not related to our implementation.

Our Http.sys implementation is 100% written in Delphi, 100% IntraWeb code (we don't use any 3rd party, nor Delphi libraries - e.g. built-in Web* stuff, except standard RTL of course).
Reply
#24
(08-21-2019, 02:44 AM)Alexandre Machado Wrote: The document you posted regarding ASP.NET is not related to our implementation.

Our Http.sys implementation is 100% written in Delphi, 100% IntraWeb code (we don't use any 3rd party, nor Delphi libraries - e.g. built-in Web* stuff, except standard RTL of course).
I haven't say IW related to ASP.net. As before, some one told me need to install IIS to let http.sys work. I check that and reply as the links.

My problem still having, http.sys would hang out to windows blue screen. Even if IIS install or not.
Reply
#25
(08-21-2019, 03:13 AM)Kristy Wrote:
(08-21-2019, 02:44 AM)Alexandre Machado Wrote: The document you posted regarding ASP.NET is not related to our implementation.

Our Http.sys implementation is 100% written in Delphi, 100% IntraWeb code (we don't use any 3rd party, nor Delphi libraries - e.g. built-in Web* stuff, except standard RTL of course).
I haven't say IW related to ASP.net. As before, some one told me need to install IIS to let http.sys work. I check that and reply as the links.

My problem still having, http.sys would hang out to windows blue screen. Even if IIS install or not.

You may be referring to my comment. 

HTTP.sys is a communication component, and it is used by IIS.  It would also be used by asp.net. IW using httpsys doesn't care about IIS or about ASP.net, it just needs the HTTP.sys communication driver that they use.

I do not know if HTTP.sys is installed without IIS, but if IIS is installed then HTTP.sys should be there.  Because of this, I suggested that you determine if IIS was installed.

Dan
Reply
#26
"My problem still having, http.sys would hang out to windows blue screen"

Something is not right on your PC and its not related to IntraWeb. IntraWeb runs in protected space, it cannot do this on its own.
Reply
#27
Thanks Kudzu and Dan, I will try again when my project done. Indy is also ok for me.
Reply


Forum Jump:


Users browsing this thread: ebertinat, 2 Guest(s)