0
我想知道如何用jquery中的參數調用函數。調用帶jquery參數的函數
以下是jQuery的代碼。我正嘗試在按鈕單擊時調用函數callAdapter。
$("#button").click(function(){
alert("message");
var $usrname = $("#text").val();
var $ipaddress = $("#text0").val();
var $port = $("#port").val();
if($usrname == undefined || $ipaddress==undefined || $port==undefined){
alert("enter data");
}
CallAdapter($usrname,$ipaddress,$port);
}
);
function CallAdapter(userName,Address,Port){
alert(username);
var invocationData = {
adapter:'TestMobileAppAdapter',
procedure:'myAdapterProcedure',
parameters:[userName, Address, Port]
};
WL.Client.invokeProcedure(invocationData,{
onSuccess:adapterSuccessCallback,
onFailure:adapterFailureCallback
});
}
請幫助我在這個..
你能詳細說明是什麼問題? – Jaykishan
CallAdapter函數沒有在按鈕點擊函數中被調用。 – svd
首先檢查您的適配器,它是否正在工作,然後從客戶端調用它。 示例代碼鏈接http://www.ibm.com/developerworks/mobile/worklight/getting-started.html它將幫助 – Jaykishan