Home » U++ Library support » U++ MT-multithreading and servers » SKYLARK js: I offer that we expanded the UxGet function a little with parameter callback
SKYLARK js: I offer that we expanded the UxGet function a little with parameter callback [message #47549] |
Fri, 27 January 2017 05:09 |
|
I offer that we expanded the UxGet function a little with parameter callback function.
It can be, by Uxget call from javascript. For example for processing of the conditional display-hiding and layout arrangement when it is necessary to cause function right after loading of AJAX of result.
example of use (in html page):
<script type="text/javascript">
var hiding = false;
function update_expand_hiding_status() {
// some updates ... of css and div attributes
}
function maintable_update(){
if (enable_update){
//UxGet($MainReportTableUpdate);
UxGet($MainTableUpdate,update_expand_hiding_status);
}
};
</script>
modification of skylark.js::
function UxGet(request,callback) // <===========Add parameter as callback function
{
var xmlhttp = AjaxRequest();
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
ProcessAjaxResult(xmlhttp.responseText.split('\1'));
if (callback) { // <=========== if parameter callback is passed,
callback();// <=========== call parameter function.
} // <===========
}
}
xmlhttp.open("GET", request, true);
xmlhttp.send();
}
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
[Updated on: Fri, 27 January 2017 06:55] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 10 00:24:01 CEST 2025
Total time taken to generate the page: 0.00803 seconds
|