I have following div which i am showing as popup: When its shown, i can easily view other part of screen in the main background. Its viewing as below: (Entry updated sucessfully is popup div above) I dont want to show background screen when poup is there. I want to make it black.. How can i make it black?? I
Tag: javascript
Restrict to 2 decimal places in keypress of a text box?
I want to enter a decimal point in a text box. I want to restrict the user by entering more than 2 digits after the decimal point. I have written the code for achieving that in the Keypress event. The code is working but the issue is: if I enter “.75” and then change it to “1.75”, it i…
Avoid dynamically injecting the same script multiple times when using chrome.tabs.executeScript(…)
I’m building a Google Chrome extension. The basic setup is I have a Browser action button that injects jQuery and another bit of JavaScript into the active tab when it is clicked to do it’s thing. This is my first Chrome extension, but it seems like if the user clicks the button to take action a s…
Plotting with HTML5 Canvas
I decided to day to embark on element and I can say so far it have been nightmare to get it work. All I want is to plot a sine graph. So after good reading I still cannot either get origins nor get it plot. Below is what I have tried (my first time ever with that tag so excuse
Do JavaScript bindings take up memory while not in use?
I have a calendar that I’ve built, and on clicking a day on the calendar, a function is run. You can go month to month on the calendar, and it generates months as it goes. Since every day on the calendar, shown or not, is binded to an event using the class of all the “days,” I’m worrie…
defining getters/setters in an object literal with a self-invoking function javascript
When defining an object literal its possible to use a self-invoking function so the function has access to private variables, But is it possible to do the same thing with a getter/setter in an object literal? Answer [edit 2022] A pretty old answer. More actual: you can create a factory function. In the snippe…
NodeJS: Would App Run Faster if Freeze Objects?
Most of my objects/functions do not change. Would the application run faster if I freeze most of the objects via Object.freeze(object)? Or will it make no difference at all? Answer Freezing (and sealing) causes a signficant performance hit instead of a gain across various browsers. Just take a look at some of…
Unable to run node app.js file
I am learning node.js and I am trying to run the app.js file using the command node app.js but the bash returns nothing (no errors either). Here are the steps I followed: $ brew install node $ sudo npm install -g express $ sudo npm install -g express-generator after i get into a new folder I created I run $
Going back to previous page using javascript
Is using JavaScript the most efficient way of navigating back to the previous page when a link or button is clicked? What if JavaScript is disabled on the user’s end (Which most people don’t)? Are there any known issues with cross-browsers? Are there any browsers that don’t support the histo…
Disable hiding of address bar on mobile
I’m working on a mobile website which has “pages” that have div’s which take up the screens full size and you can scroll between each one. The problem is, the window resizes whenever a user scrolls downward because the address bar hides. This causes problems when you scroll to the comp…