Problems: 1. in the test environment, neither Firefox nor Chrome can call back the checkSIGNIN_callback method. Diagnosis: Listening to port 89 on the server, arrival of data requests, normal return of JSON format data solution: Debugging Using Ripple of IM 2. test the code on the BlackBerry real machine... syntaxHighligh
Problems:
1. Test Environment
Neither Firefox nor Chrome can call back the checkSIGNIN_callback method.
Diagnosis: Listening to port 89 on the server, Data Request arrival, normal return of JSON format data
Solution: Debug using Ripple of IM
2. Test on the BlackBerry real machine. The code does not successfully perform network access.
Diagnosis: Listening to port 89 on the server finds that no data request arrives or data is returned.
Possible problem: a) access controll B in the config. xml file) access to special port 89 on the carrier (China Unicom) Network
Solution: Modify the port or port ing on the server, change port 89 to port 80, and change port 89 to port 80 in the program.
(To ensure that the original exlive Server user can log on normally, I mapped 89 to two external ports 80 and 89 on the vro)
Code snippet:
[Javascript]
Function checkSIGNIN_callback (data ){
[Javascript] view plaincopy
If (data. signInTime = "") {// not sign in
$ ("# Signin_button"). text ("sign in ");
$ ('# Signin_button'). button ('refresh ');
} If (data. signOutTime = "") {// not sign out
$ ("# Signin_button"). text ("check out ");
$ ('# Signin_button'). button ('refresh ');
} Else {
$ ("# Signin_button"). text ("sign-in/check-out ");
$ ('# Signin_button'). button ('refresh ');
}
Alert (6 );
}
Function checkSIGNIN (){
Alert ("gPhone is" + gPhone );
JQuery. support. cors = true;
CheckSIGNIN_url = "http://shanghai.springworks.info: 89/pgps/empPr/empParamAction_sendEmpParam.action? Phone = "+ gPhone;
$. GetJSON (checkSIGNIN_url, checkSIGNIN_callback );
}