이 마젠토베이스 JS 라인은 무엇을 의미합니까?
-
12-12-2019 - |
문제
이 JavaScript 라인은 App / Design / Frontend / Base / Default / Template / Persistent / Checkout / OnePage / Billing.phtml :
의 Magento 기본 코드에 있습니다. $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
.
여기서는 맥락의 라인이 있습니다 :
<script type="text/javascript">
//<![CDATA[
var billing = new Billing('co-billing-form',
'<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/',
'<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
var billingForm = new VarienForm('co-billing-form');
/*billingForm.setElementsRelation('billing:country_id',
'billing:region',
'<?php echo $this->getUrl('directory/json/childRegion') ?>',
'<?php echo $this->__('Select State/Province...') ?>');*/
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
var billingRegionUpdater = new RegionUpdater('billing:country_id',
'billing:region',
'billing:region_id',
<?php echo $this->helper('directory')->getRegionJson() ?>,
undefined,
'billing:postcode');
if ($('onepage-guest-register-button')) {
Event.observe($('onepage-guest-register-button'), 'click', function(event) {
var billingRememberMe = $('co-billing-form').select('#remember-me-box');
if (billingRememberMe.length > 0) {
if ($('login:guest') && $('login:guest').checked) {
billingRememberMe[0].hide();
} else if ($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
billingRememberMe[0].show();
}
}
});
}
//]]>
</script>
.
두 값을 비교하는 것 같지만 비교로 아무 것도하지 않습니다.그것의 목적은 무엇입니까?
해결책
나는 이것에 대한 연구를했습니다.나는 && & & & "와"라고 생각했지만 "그 다음에 그렇다면"바로 가기로 사용할 수도 있습니다.
$ ( 'Billing-Address-Select')가 true 인 경우 newAddress 함수 (opcheckout.js의)는 "! $ ( '청구 주소 선택")를 사용하여 호출됩니다. "논쟁.한 페이지 체크 아웃에서 새 주소 양식을 프로그래밍 방식으로 표시하거나 숨길 수있는 이상한 방법입니다.
여기에 스택 오버플로 질문이 있습니다. https://stackoverflow.com/ questions / 3859433 / an-shorthand-in-in-in-in-in-in-in-
및 & vs &&에 대한 좋은 설명 https://stackoverflow.com/questions/7310109/whats-the-difference-사이에 - 인 -JavaScript
제휴하지 않습니다 magento.stackexchange