Javascript question

Does the article ’ Using complex types (JavaScript)', that’s referred to here still exist anywhere? I know this isn’t really an RO question, but I’m just trying to work out how to correctly get the result, for something like this from the intf file, and all the results searching here point to that as a starting point:

__namespace.LoginService.prototype.Login = function(
	UserID,
	Password,
	__success, __error) {
	try {
		var msg = this.fMessage.clone();
		msg.initialize(this.fServiceName, "Login");
		msg.write("UserID", "WideString", UserID);
		msg.write("Password", "WideString", Password);
		msg.finalize();
		this.fChannel.dispatch(msg, function (__message) {
		var __result = __message.read("Result", "Integer");
		var __a = __message.read("a", "LoginInfo");
			__success(
		__result
		,
		__a
		);
		}, __error);

	} catch (e) {
		__error(msg, e);
	};
};

Where LoginInfo is a ROComplexType.

check UsingComplexTypes page


here __success and __error are callback methods.

From JavaScript Callbacks :

function myDisplayer(some) {
  document.getElementById("demo").innerHTML = some;
}

function myCalculator(num1, num2, myCallback) {
  let sum = num1 + num2;
  myCallback(sum);
}

myCalculator(5, 5, myDisplayer); 
1 Like