Getting error If I invoke kite.connect more than once.

sudhagowda
Hi,

We are using kite connect publisher buttons. My code is working the first time. Next time onwards I am getting the folowing error.

publisher.js:106 Uncaught TypeError: Cannot read property 'document' of null
at popup (publisher.js:106)




My code is as follows

function execute_trade(transtype){
let kite = new KiteConnect("xxxxxx")
let data={
"tradingsymbol": "TCS",
"exchange": "NFO",
"transaction_type": "BUY",
"order_type": "MARKET",
"product": "MIS",
"quantity":10,
"readonly": true
}
kite.add(data);
kite.connect();
}

Let me know if need to do anycleanup on the first trade completion.




Sign In or Register to comment.