나는 연관 배열이 있고 jquery로드 메서드의 매개 변수 섹션에 전달하려고합니다. 그러나 그것은 서버 측에 게시물로 나타나지 않습니다. 이것을 어떻게 할 수 있습니까? 내가 좋은 대답을 얻었다 하지만, 좀 더 많은 연구를했고, 아주 잘 자바 스크립트에서 연관 배열을 설명하는 좋은 링크를 발견 :jquery ajax 전달 정보를 사용하여
var selectcustomerpopup = null;
$(document).ready(function() {
// Find customer
$('.CustomerSelectBtn').click(function() {
var uniqueid = $(this).attr('id');
var customerSelectURL = $('#ajax_customer_select_url').val()
+ "/" + uniqueid;
var custselectdata = new Array();
custselectdata["fname"] = "TestFirst";
custselectdata["lname"] = "TestLast";
if (! ($('#selectCustomerDialog').length)) {
$('body').append(
$('<div id="selectCustomerDialog" style="display: none;"></div>')
);
}
var $findCustomerDialog =
$('#selectCustomerDialog').load
(customerSelectURL, custselectdata)
.dialog({
autoOpen: false,
title: 'Select Customer',
width: 630,
height: 450,
position: 'center',
resizeable: true,
modal: true,
draggable: true,
closeOnEscape: true,
closeText: 'close'
});
$findCustomerDialog.dialog('open');
selectcustomerpopup = $findCustomerDialog;
return false;
});
});
추가 정보 : 여기
내 코드입니다 http://blog.xkoder.com/2008/07/10/javascript-associative-arrays-demystified/
난 당신이 대상으로'custselectdata' 배열을 교체하기 만하면 생각 : 당신은 단지 물건으로
custselectdata
배열을 교체해야'var에 custselectdata = {}; ' – Blazemongermblase, 당신은 대체 정답이 있었다 객체를 만들기 위해 {}을 사용하는 배열이 효과가있는 해결책 이었지만 선택할 수있는 대답이 없습니다. – stephenbayer