Skip to content

Tag: javascript

extract private key from .pem file

I want my code to extract private key from my pem file . My pem file looks like this -> —–BEGIN RSA PRIVATE KEY—– some encrypted code —–END RSA PRIVATE KEY—– . I have the same code in ruby but i’m not able to do this in javascript. Answer Keep in mind, …

Hide elements without knowing complete id

I have a table like below I want to hide all rows except row whose id contains id4. I won’t have full id. I came up with below jQuery code, but as I don’t have full id, it doesn’t work. How to filter with only half the id? Answer You can use the “Attribute starts with” selector t…

Can’t render two charts on the same page from chart.js

I’ve been trying for the past hour to get Chart.js to render two line charts on the same page. I have ensured that my canvas element IDs are unique, as are my variables. I am able to successfully load the first chart, ctx or canvas, but not the second chart, ctx2 or canvas2. This is using chart.js v2.8.…

Dark Mode After 1700 hours

I’m trying to change the background and one (1) heading to different colors after a certain time on my webpage (1700 hours). However, it doesn’t trigger. What am I doing wrong here? Answer

change array element value’s style

im building a to-do list but cant figure out how to keep my array values that have line-through decoration. the moment render method is called, the array is built from the start. means that if i delete an li, all other li that have been marked by the checkbox with a line-through, losing the decoration. what c…

Trying to recursively hash values in object

friends. I’m trying to write code that hashes all values in a JSON file, regardless of file structure, while preserving the keys and structure. I’m new to javascript, and am having some trouble. My code hashes the values of big and baz, but doesn’t recursively hash the values of cat and bar …