Skip to content

Regex expression to match certain url behavior in my website

I have the following url I’ve trying to create a regEx so i can thrigger a script only when i’m in an article. i tried this among other tests but it didn’t work and i’m not really the best guy building RegExs. So in my understanding the first part of this regEx (/blogs/) is trying just…

Display yellow warning message in console

I want to show a warning message in the Chrome console, like the highlighted item in this screenshot: console.log(message) displays a normal white message. console.error(message) creates an error message. But using console.warning(message) returns Uncaught TypeError: console.warning is not a function. So is t…

Issue with component array filter

I want to create multiple components and delete them by pressing on button click. I created the components. But i can’t delete it. I wanted to give unique id to the Card component. But when i click one of cards’ buttons,all of cards are gone. I displayed the component array like this: Answer From …

Fill the empty values in my JSON (not null or “”)

I have a raw data that looks like that : I need to fill those empty values to be able to use it as an object. It’s not me who create it, I got it from an external source. I know how to fill those empty values if they were like “” or null. Sometime there is a coma after

Cleaning input versus not allowing input

I`m working on securing my website against XSS attacks starting with java script. I have read that I can escape user input using < etc.. However I personally would prefer to just not allow user input such as <, “, ‘, .cookies, alert(, etc.. Would there be a security risk in that method? Answ…