Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

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

Previous Topic: How to create sockets that don't block the GUI?
Next Topic: Error in RpcServer example
Goto Forum:
  


Current Time: Mon Apr 06 19:32:16 CEST 2020

Total time taken to generate the page: 0.01076 seconds