//상품상세 이미지 사이즈(높이값) 저장 $(document).bind("readystatechange", function () { try { if (typeof document.readyState == undefined || document.readyState != "complete") return; var height = $('#basic_detail_html').height(); $.ajax({ type: 'POST', dataType: 'json', url: '/Etc/RegisterItemDetailViewHeight', data: { goodsCode: '1720242692', height: height }, async: true, success: function (res) { }, error: function (result) { } }); } catch (ex) { } }); $('#button__fora11y').on('click', function () { var clicked = $(this).data("clicked"); if (clicked) { alert("이미지 대체텍스트 호출되었습니다.페이지 새로고침하고 다시 호출하세요."); }else { OCR_ALT_TEXT(); } }); var OCR_ALT_TEXT = function () { $.ajax({ type: 'POST', dataType: 'json', url: '/Item/GetTextGoodsCode', data: { goodsCode: '1720242692', detailVersion: Number('2')}, async: true, success: function (res) { if (res && res.length) { res.map(function (item) { $("#basic_detail_html img").each(function () { var src = $(this).attr("src"); if (src.trim() === item.u.trim()) { $(this).attr("alt", item.t); }; }); }); }; alert("OCR 대체텍스트 처리가 완료되었습니다.이미지에 따라 대체텍스트의 정확도가 떨어질 수 있음을 감안하여 주시기 바랍니다."); $('#button__fora11y').data("clicked", true); }, error: function (err) { console.log(err); } }); }