ajax json 질문드립니다!

ajax json 질문드립니다!

QA

ajax json 질문드립니다!

본문


function goods_detail_load_origin(goods_nid, ad_nid) {
        var post_url = 'include/goods_detail.ajax.html';
        $.ajax({
            type: "POST",
            dataType: 'json',
            url: post_url,
            data: 'goods_nid=' + goods_nid + '&ad_nid=' + ad_nid,
            success: function(data){
            //alert(data);
                if(data.nid > 0) {
                    $('html').css('overflow','hidden');
 
                    $("#goods_detail #df_goods_name").html( data.df_goods_name );
                    $("#goods_detail #df_goods_comment").html( data.df_goods_comment );
                    $("#goods_detail #df_category").html( data.df_category );
                    $("#goods_detail #df_area").html( data.df_area );
                    $("#goods_detail #df_target").html( data.df_target );
 
                    $("#goods_detail #df_limit_price").html( data.df_limit_price + ' 이내');
                    $("#goods_detail #df_year_rate").html( data.df_year_rate );
                    $("#goods_detail #df_over_rate").html( data.df_over_rate );
                    $("#goods_detail #df_repay_rate").html( data.df_repay_rate );
                    $("#goods_detail #df_action_time").html( data.df_action_time );
                    if (data.df_return_period == '상담후협의')
                    {
                        $("#goods_detail #df_return_period").html( data.df_return_period );
                    }else{
                        $("#goods_detail #df_return_period").html( data.df_return_period + ' 이내');
                    }
 
                    $("#goods_detail #df_return_type").html( data.df_return_type );
                    $("#goods_detail #df_document").html( data.df_document );
 
                    $("#goods_detail #loan_corp_name").html( data.loan_corp_name + data.opening_check);
                    $("#goods_detail #ad_tel1").html( data.ad_tel1 );
                    $("#goods_detail #ad_tel1_btn").html( data.ad_tel1_btn );
                    $("#goods_detail #ad_tel1_url").attr('href', 'tel:'+data.ad_tel1);

 
                    $("#goods_detail #homepage, #goods_detail #homepage_url").html( data.homepage );
                    if( data.homepage_btn ){
                        $("#goods_detail #homepage, #goods_detail .homepage_url").attr( {"href":data.homepage, 'target':'_blank'} );
                        $('.homepage_url_img').css('display','inline-block')
                    }else{
                        $("#goods_detail #homepage, #goods_detail .homepage_url").attr( {"href":'###', 'target':''} );
                        $('.homepage_url_img').css('display','none')
                    }
                    $("#goods_detail #homepage_btn").html( data.homepage_btn );
                    $("#goods_detail #ceo").html( data.ceo );
                    $("#goods_detail #loan_reg_no").html( data.loan_reg_no );
                    $("#goods_detail #part_name").html( data.part_name );
                    $("#goods_detail #part_tel").html( data.part_tel );
                    $("#goods_detail #address").html( data.address );
                    $("#goods_detail #opening_info").html( data.opening_info );
                    $("#goods_detail #smatch_btn").html( data.smatch_btn );
                    if( data.loan_corp_logo ) {
                        $("#goods_detail .infobox02").removeClass('logo_no');
                        $("#goods_detail #logo_img").attr("src", data.loan_corp_logo);
                    } else {
                        $("#goods_detail .infobox02").addClass('logo_no');
                        $("#goods_detail #logo_img").attr("src", $("#goods_detail #logo_img").attr("data-src"));
                    }
 
                } else {
                    alert("대출상품 데이터를 가져오는데 실패했습니다.");
                }
            }
        });
}

공부중인데 이 코드를 토대로 goods_detail.ajax.html 파일을 작성하려고 하는데 감이 안잡히네요 ㅠ

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 406
QA 내용 검색
filter #ajax ×

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT