sciter-前端发送数据给后端

  $(#scan_Now).onClick = function(){
		
	/*	var myArray=new Array();

		myArray[0] = $(#aaTestID_1).checked;
		myArray[1] = $(#aaTestID_2).checked;
		myArray[2] = $(#aaTestID_3).checked;
		myArray[3] = $(#aaTestID_4).checked;
		myArray[4] = $(#aaTestID_5).checked;
		myArray[5] = $(#aaTestID_6).checked;
		myArray[6] = $(#aaTestID_7).checked;
		myArray[7] = $(#aaTestID_8).checked;
		myArray[8] = $(#aaTestID_9).checked;
		myArray[9] = $(#aaTestID_10).checked;
		myArray[10] = $(#aaTestID_11).checked;
		myArray[11] = $(#aaTestID_12).checked;
		for(var i = 0; i

代码优化 html与后端交互代码优化/。上面的代码都是第一代:

 $(#scan_Now).onClick = function(){
		
		$(#regis_70_2).style["display"] = "block";
		$(#regis_70_1).style["display"] = "none";
		var iParam = 0;
	
		var secChk1 = $(#second_chk_1);
		var chk = secChk1.$$(input);  //拿到整个div里面带input属性的控件存入数组,本身就是数组
		var sum = 0; //筛选判断条件
		var j = 0;
		for( var tmpv in chk)
		{
	     if(tmpv.checked != false)
	     {
		   iParam |= 1 << j;
		   stdout.println(j);
		 }
		 j++;
		}
		stdout.println(iParam);
		view.CallCbc(iParam);
	};

 

前段代码。复选框的操作;

后端:.h函数的声明

	BEGIN_FUNCTION_MAP	
    FUNCTION_1("CallCbc", CallC);
	END_FUNCTION_MAP

	sciter::value  CallC(sciter::value Bool_att);

 

.cpp函数里面的操作

//复选框取状态
sciter::value Mysciter::CallC(sciter::value Bool_att)
{
	//bool check_box = Bool_att;



	sciter::value Bool_att1 = Bool_att;  //d选中是1.没有就是0

这里是一次一次的获取,前端页能一次性获取


	return Bool_att1;
}

未完;

你可能感兴趣的:(sciter,MFC,第一次工作,webview)