Cross-domain Access using jquery's Getjson method in WebWorks

Source: Internet
Author: User

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);
}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.