Skip to content

Tag: javascript

webgl trying to draw a triangle

I have been trying to draw a triangle but it is not showing up on the canvas here is my draw function code: here is the whole work: Answer There are some issues: The properties gl.viewportWidth and gl.viewportHeight are never set: In the array of vertex coordinates is a , instead of a . And there is a typo ,

getSelection not working properly in iOS 12

Functions document.getSelection() and window.getSelection() do not work in iOS 12. The problem is reproduced in Safari, Google Chrome and WKWebView. In iOS 11 and MacOS (any version), these functions are work. Can you advise? Example: Answer I don’t really know why document.getSelection() and window.get…

How can you use axios interceptors?

I have seen axios documentation, but all it says is Also many tutorials only show this code but I am confused what it is used for, can someone please give me simple example to follow. Answer To talk in simple terms, it is more of a checkpoint for every HTTP action. Every API call that has been made, is passed

Chart.js 2.7.2- Multiline get point value onClick

I would like to get value foreach point value. Don’t work because when I click on point I obtain only of the first line value. GetElementsAtEvent give me an array of 3 element (element active) but how I can get the clicked value? This the Complete code. Thanks Answer To get the exact element, use ctx.ge…