Thursday 27 June 2019

Preview an image before it is uploaded.

manjeet is id input type image , you want to show "image"

onchange="document.getElementById('manjeet').src = window.URL.createObjectURL(this.files[0])"

Friday 14 June 2019

How to integration Razorpay paymet method .

<button id="rzp-button1"><p>Pay with Razorpay</p>
</style>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
</script>
<script>
var options = {
    "key": "rzp_live_dk2jtJQUNH81P5",
    "amount": "10000", //  = INR 1
    "name": "Manjeet Kashyap",
    "description": "A Wild Sheep Chase is the third novel by Japanese author Haruki Murakami",
    "image": "https://cdn.razorpay.com/logos/7K3b6d18wHwKzL_medium.png",
    "handler": function (response){
        alert(response.razorpay_payment_id);
    },
    "prefill": {
        "name": "Gaurav Kumar",
        "email": "gaurav.kumar@razorpay.com"
    },
    "notes": {
        "address": "note value"
    },
    "theme": {
        "color": "#6A59CE"
    }
};
var rzp1 = new Razorpay(options);
document.getElementById('rzp-button1').onclick = function(e){
    rzp1.open();
    e.preventDefault();
}
</script>