Skip to content
Advertisement

Category: Questions

Javascript Hanging UI on IE6/7

Could anyone suggest performance improvements for the function I’ve written (below, javascript with bits of jquery)? Or point out any glaring, basic flaws? Essentially I have a javascript Google map and a set of list based results too, and the function is fired by a checkbox click, which looks at the selection of checkboxes (each identifying a ‘filter’) and whittles

Why doesn’t JavaScript newlines work inside HTML?

I have the following: As you probably all know, n doesn’t work and I have to use <br> instead. It won’t work either if I link to an external .js file. Here are my questions: Why doesn’t n work? Why does <br> even work? Shouldn’t everything that’s inside the script tags be strictly JavaScript instead of a dirty mix between

Format a Number, Exactly Two in Length?

I have an integer that is less then 100 and is printed to an HTML page with JavaScript. How do I format the integer so that it is exactly two digits long? For example: 01 02 03 … 09 10 11 12 … Answer Update This answer was written in 2011. See liubiantao’s answer for the 2021 version. Original

Change CSS of class in Javascript?

I’ve got a class with the display set to none I’d like to in Javascript now set it to inline I’m aware I can do this with an id with getElementById but what’s the cleanest way to do it with a class? Answer You can do that — actually change style rules related to a class — using the styleSheets array (MDN

JQuery Error: Uncaught TypeError: Object # has no method ‘ready’

my site is getting the error in this title in the javascript console. Google seems to say that it is because jquery isn’t loaded, but it is definitely visible in the head. the site is medical marijuana related, so nsfw for some.sorry for the messy head, it’s in dev mode. http://www.kindreviews.com/1/mmc/ Thanks, zeem Answer Apparently you are using both jQuery

Disable submit button on form submit

I wrote this code to disable submit buttons on my website after the click: Unfortunately, it doesn’t send the form. How can I fix this? EDIT I’d like to bind the submit, not the form 🙂 Answer Do it onSubmit(): What is happening is you’re disabling the button altogether before it actually triggers the submit event. You should probably also

Advertisement