step-02.php
파일을로드 한 후에 변수 "hotel"을 사용하는 방법은 무엇입니까?jQuery에서 PHP 파일을로드 한 후 함수에서 변수를 사용하는 방법은 무엇입니까?
$(function() {
var hotel = [];
$('#forPrice').on('click', function() {
$('select').each(function() {
if($(this).val() > 0 && $(this).val() < 10) {
var room = {};
room["room"] = $(this).attr('room');
room["price"] = $(this).attr('price');
room["val"] = $(this).val();
room["html"] = $(this).parents(".selectRowRoom").html();
hotel.push(room);
}
});
console.log(hotel);
});
$('#forPrice').click(function() {
$('#Step-01').hide();
$('#Step-02').show();
$('.hiddenAndShow').hide();
$("#Step-02").load('step_02.php');
});
})
제가
실 [ "HTML"] = $ (이) .parents (". selectRowRoom")를 필요로 HTML을().;
로드 후 단계 - 02.php.
step-02.php
<div class="thisRoom">
// Insert room["html"] = $(this).parents(".selectRowRoom").html();
</div>
에 액세스하기위한 삽입 준비가 화재 콜백을 가지고? – xzegga
@xzegga 안녕하세요.이 질문이 맞습니다. – mySun
그래서'.thisRoom'이 step_02.php에 있는지 또는 무엇을 말하고 싶습니까? – adeneo