2016-07-21 1 views
-1

이 코드 유형을 만드는 방법, 코드 가져 오기 버튼을 클릭하면 전자 상거래 상점의 다른 탭으로 리디렉션되며 클릭하면 쿠폰 코드가 나타납니다.작은 코드 도움말

enter image description here

+0

모든 출력 아직 ? – Sherlock

답변

2

HTML을

// use button 
<button onclick="Redirectpage()">Coupon Code</button> 

// use Img 
<img src="" onclick="Redirectpage()"/> 

당신의 자바 스크립트 코드에서 자바 스크립트

function Redirectpage() { 
    location.href = "Put Your website here; 
} 
+0

작동하지 않습니다. 어쩌면 내가 실수를하고 있습니다. 적절한 코드를 제공 할 수 있습니까? 제발 기술 분야가 아닙니다. –

0
<a href="<your new link here>" target="_blank" class="coupon_code">Coupon Code</a> 

$(document).ready(function(){ 
    $(".coupon_code").click(function(){ 

     // place your javascript code for open popup of coupon code 

     return true; // it will redirect to href link in new tab 
    }); 
}); 
0

시도해보십시오.

$('button').on('click',function()({

`$(this).html('your coupon code here');` 
    ` window.open('https://link.com', '_blank'); 

});