Skip to content

Tag: javascript

Google charts from MySQL

I have tried for several hours to get MySQL data in a Google charts but I can’t wrap my head around how to make a working page from the examples I’ve come across on the internet. To start fresh I took a example from Google charts and manually filled it with data. This gives me the graph I want to

Prevent PDF auto download by idm using pdf.js

I’m using PDF.Js to embed PDF file for preview, and I removed the script of download and open files from the viewer.js , but when I test the page and PDF file try to show, the Internet Download Manager download it and abort the preview .. after search I found that using object instead of iframe may solv…

Mongoose date field – Set default to date.now + N days

In a mongoose schema such as: On the line for the “end” field the default date should set to +7 days. I can add presave hook and set it there, but wondering if theres a way to do this inline in the default field. Answer You can add 7 days converted to milliseconds to current date like this or even

Javascript selected text highlighting prob

I have a html page with text content. On selecting any text and pressing the highlight button, I can change the style of the selected text to highlight the same. To implement this feature, i have written the following method. This is working fine if you choose a text with no html tag, but when the text has an…