DanielBullimore / OOmutiny

OO Javascript frontend
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

0.3 Web Request #11

Closed DanielBullimore closed 4 years ago

DanielBullimore commented 5 years ago

Priority: Unset

Depends:

0.0 Master (OO)-[OO.class.js]

UML:

OoWebRequest-29-10-2019

Description:

ajax controller. Every class that inherits this one will have its own dedicated ajax request method.

Overview:

Encapsulates all code required to make and control an ajax request then processes results.

Methods:

funAddPostData(strPostKey, ValueForKey) - adds a name=>value pair to the string of data to be posted to server with next request.

funDoAjaxRequest() - Triggers the Ajax request to server. Runs funSuccess() when request response is retrieved.

funSuccess() - code to run when ajax request is successful. can be set to a function() after instance declaration and before the request is sent.

funStoreData() called after Ajax request is successful. 
funClearPostData() - clears all name=>value pairs from strURIPostData.         

Properties:

        objAjax - private object, An instance of XMLHttpRequest (works for all browser including IE)
        booHttpGet  - public boolean, The method of HTTP to use in Ajax request false = "POST" and true = "GET"
        strRequestUrl   - public string, A URL to request via Ajax
        strURIPostData  - protected string, the post data to send to server with "POST" requests. Set using funAddPostData();

        strResponse - public string, contains the server respose.
DanielBullimore commented 5 years ago

Still needs method to switch the Boolean values. zzzz

DanielBullimore commented 4 years ago

sanity checking finds: strUriPostData cant be cleared getresponseText() corrected to funStoreData()

DanielBullimore commented 4 years ago

sanity checking finds: strUriPostData cant be cleared getresponseText() corrected to funStoreData() UML updated, funClearPostData() added. Sanity check passed OoWebRequest-29-10-2019