Skip to content

javascript is unable to working on infinite scroll

I have a website which have multiple posts and each post have a like button with auto timeout modal popup. When scrolling down, more posts loaded with infinite.js. Which load the posts. The problem : In the first page the like button with timeout modal popup does work. But when the posts load in infinitely th…

Find Duplicates from Arrays with Substring

I have 2 arrays that have different ways of writing the same address. For instance, Ex: Because the way the addresses are structured, I figured I could get the substring of each item in the array and then filter it, but I’m running into an issue where it doesn’t seem to be storing the matches when…

How to set 4.5 stars with jQuery on page load?

I am trying to make sure that when the page is loaded, the rating is automatically filled with 4.5. There must be four and a half stars active (yellow) with jQuery. My code: What can I do in jQuery to give 4.5 stars to this? Answer The easiest method is to set the value directly in the HTML: using the

Is this bad practice for res.locals? (Node.js, express)

I was wondering if using res.locals like in this code example is bad practice or if there can occur any problems if you use it this way: Basically I: I verify the session-cookie in app.use (Im using firebase auth) I set the res.locals.userId = userId And then use the local i just set in the app.get (I need to…