Skip to content
Advertisement

Javascript array search and remove string?

I have: I want to be able to do something like: array.remove(“B”); but there is no remove function. How do I accomplish this? Answer I’m actually updating this thread with a more recent 1-line solution: The idea is basically to filter the array by selecting all elements different to the element you want to remove. Note: will remove all occurrences.

Set a default sort column in SlickGrid

I’m using SlickGrid with DataView and I’m trying to set a default sort column on my table. Is there a way to trigger the sort or set an option so the column is sorted on load? Answer On the latest version you could do this: You can also set multiple with setSortColumn*s*

javascript shifting issue (rgb and rgba to hex)

I found a RGB to hex converter and I’m trying to make a RGBA to hex converter. The original rgb2hex function works but the new rgba2hex function does not. What am I doing wrong? The rgba function is returning gba, no r. Example: Current output: ff9b2d and 9b2dff Expected output:ff9b2d and ff9b2dff Answer Your issue is that bitwise math in

HTML5 – passing Canvas between files

I have two html files, say 1.html and 2.html with 1.js and 2.js referenced javascripts. In 1.html I have a Canvas object with drag and drop functionality, so that i use drawImage method for adding additional images to the canvas. When I am finished with adding images on 1.html, i save the canvas to the localStorage. Shortly it would be

Javascript Page Load Total

I’ve created a form that is used to calculate monthly expenses. The problem I’m having is on the last page I’m gathering information from previous pages (session to data) that auto fills the fields on the last page. I’ve created a Javascript that is suppose to subtract the five fields on the page for a grand total but this doesn’t

Change jquery ui datepicker programmatically

I’ve got a jquery ui datepicker on my page. It’s linked to a span not an input. It’s currently tweeked to select a week at a time. I’ve also got two buttons on my page ‘Previous Week’ and ‘Next Week’. I want the buttons to control what’s selected by the datepicker. (ie jump forward / backward by one week when

Advertisement