1
나는 심지어 TI는이 기능이 아약스 기능
function GetProductById(iProductId)
{
var ProductInfo=new Array();
console.log("2");
$.ajax({
type: 'POST',
url: 'services/ManageCategoriesServices.asmx/GetProductById',
dataType: 'xml',
'data': {'iProductId': iProductId },
success: function(data) {
source = null;
try
{
console.log("source product-> ",data.activeElement.childNodes);
myGlobalArray=TestProduct(data.activeElement.childNodes);
console.log("In Ajax myGlobalArray-> ",myGlobalArray); return myGlobalArray;
}
catch(e) {
$('#m_lblStatus').text('failed to read json');
}
},
fail: function() { $('#m_lblStatus').text('fail');}
});
return myGlobalArray;
}
에게 전화
var ProductInfo=new Array();
myGlobalArray=GetProductById(iProductId);
를 넣어 드래그에서 카트 영역 뿌리로 항목을 드래그 할 때 정보 내 배열을 작성해야
로 배열을 전달하는 방법
myGlobalArray가 필요한 전체 정보를 얻을 수 있는지 확인했지만 배열을 복사하려고 할 때 첫 번째 함수로 돌아갈 때
아약스에서 63,210그것은 비어가 더 아이가 평소 내가 전역 작동합니다 생각 때문에 작동하지 않습니다 때문에 글로벌 배열을 사용
오브젝트 없습니다 있습니다
라고하지만 나는 그것을 볼 가득 차 있지만 첫 번째 기능에서는 비어 있습니다.
In Ajax myGlobalArray-> ["medium_101-01-004-02.jpg", "303", "101-01-004-02", "44.95"] After Ajax myGlobalArray-->[] There are no child objects
어디에서 문제가 발생합니까?
참고 : 필연적으로 FALSE '입니다 *하지 * 권장 솔루션 있기 때문에 것 [ 다른 문제로] (http://stackoverflow.com/questions/17146392/function-in-javascript-take-to-maucu-time-and-this-stop-the-scipt). – JJJ
흠 ... 몇 번이나 사용했지만,이 문제는 생기지 않지만, 장래에 조심스럽게 조언 해줘. –