|
本帖最后由 jyjy 于 2017-7-10 09:56 编辑
-
- var Model = function(){
- this.callParent();
- };
-
- Model.prototype.button1Click = function(event){
-
- var self = this;
- var returnJson;
- var userData = this.comp("userData");
- //用户名和密码为空提示
- if ( $.trim(this.comp('username').val()) === "" || $.trim(this.comp('password').val()) === "") {
- this.comp("messageDialog").show({
- "title" : "温馨提示",
- "message" : "忘记输入用户名或密码?"
- });
- } else {
- var MD5 = require('$UI/system/lib/base/md5');
- MD5 = new MD5();
-
- var params = {
- "username":this.comp('username').val(),
- "password":this.comp('password').val()
- };
-
- $.ajax({
- async: false,
- "type" : "post",
- "url" : "http://localhost/webservice/n_webservice.asmx/get_stock",
- "dataType" : "xml",
- "jsonp" : "CallBack",
- "data" : {
- "as_user" :params.username,
- "as_password":MD5.hex_md5(this.comp('password').val())
- },
- "success" : function(data){ //回调函数,result,返回值
- var datas = data.getElementsByTagName("string");
- returnJson = datas[0].firstChild.nodeValue;
- },
- "error" : "error"
- });
-
- //怎么没有执行以下代码? var success = function(resulData) 不起作用吗?</font>
- var success = function(resultData) {
- userData.loadData(resultData);
- userData.refreshData();
- // alert(returnJson);
复制代码 //怎么没有执行以下代码? var success = function(resulData) 不起作用吗?</font> var success = function(resultData) {
userData.loadData(resultData);
userData.refreshData();
|
|