topic description
I want to dynamically modify the title according to the latest pushed price, but I don"t want to do it. DOM, then how should I implement it?
sources of topics and their own ideas
referring to https://www.hbg.com/zh-cn/coi.
, my previous idea is to get the latest market price and market name when the page is initialized, and then modify the value of Title through document.title. After that, Websocket pushes it once, and changes the value of title once. This is really possible. However, there will be big performance problems
related codes
/ / Please paste the code text below (do not replace the code with pictures)
/**
*
*/
getWebsiteConfig:function(data){
let self = this;
//
self.getWebsiteConfig = data.webTitle;
// title (newPricemarketName )
let title = self.formatFloat(self.newPrice,self.pointRoundPrice) + " " + self.marketName + " | " + self.getWebsiteConfig;
document.title = title;
},
what result do you expect? What is the error message actually seen?
the result I most expect is to be able to change the value of the title without a DOM operation, following the latest price change.