The problems encountered:
Question 1. Firefox, Chrome can't callback Checksignin_callback method
Diagnostics: Monitor 89-port data access on the server with Wireshark. A data request was found to reach Port 89, the server returned the JSON-formatted data to the client normally
Solution: Use RIM's ripple to debug, do not use Firefox, chrom
Question 2. The BlackBerry is tested on the real machine, and the code has problems with no access to the server.
Diagnostics: Listen on port 89 on the server and find no data requests to arrive and no data to return.
The possible crux of the matter:
A) config.xml files inside Access controll
(b) operator (Unicom) network access restrictions on special port 89
c) BlackBerry BES Server does not run access to the TCP port except the 80,8080 port
Workaround:
A the server to do port modification or port mapping, the last 89 port to 8080 port, and the program to change port 89 to 8080.
JQuery Code fragment:
Note to cross domain access, you need to add a sentence
JQuery.support.cors = true;
function Checksignin_callback (data) {
if (Data.signintime = = "") { //not sign in
$ ("#signin_button"). Text ("check-in");
$ (' #signin_button '). Button (' refresh ');
if (Data.signouttime = = "") { //not sign out
$ ("#signin_button"). Text ("Checkout");
$ (' #signin_button '). Button (' refresh ');
else {
$ ("#signin_button"). Text ("check-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);
}