简体   繁体   English

自动点击页面加载

[英]Auto click on page load

The below mentioned code loads a page with a buy the basket button.下面提到的代码加载了一个带有购买篮子按钮的页面。 Currently i manually click the button to run the code Can anyone add a auto click the button after the page loads.目前我手动单击按钮运行代码任何人都可以在页面加载后添加自动单击按钮。 I am a total dumb in coding.我在编码方面完全愚蠢。 A fully ready code is required.需要一个完全就绪的代码。 Please help.请帮忙。

<!-- The basket will be linked to this element's onClick //-->
<button id="custom-button" autofocus >Buy the basket</button>



<!-- Include the plugin //-->
<script src="https://kite.trade/publisher.js?v=3"></script>

<script>
// Only run your custom code once KiteConnect has fully initialised.
// Use KiteConnect.ready() to achieve this.
KiteConnect.ready(function() {
    // Initialize a new Kite instance.
    // You can initialize multiple instances if you need.
    var kite = new KiteConnect("tlhzuxkhbqzcvxrw");

    // Add a stock to the basket
    kite.add({
        "exchange": "NSE",
        "tradingsymbol": "INFY",
        "quantity": 5,
        "transaction_type": "BUY",
        "order_type": "MARKET"
    });


    // Register an (optional) callback.
    kite.finished(function(status, request_token) {
        alert("Finished. Status is " + status);
    });

    // Render the in-built button inside a given target
    kite.renderButton("#default-button");

    // OR, link the basket to any existing element you want
    kite.link("#custom-button");
});
</script>

$(window).load(function (){ $("#custom-button").click(); }); Please give click event on page load.请在页面加载时给出点击事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM