Skip to content
Advertisement

Tag: jquery

How to convert variables into json?

I want to send json data to ajax but how do you convert variables into json or convert an array to json? Answer If you really want to convert the data into JSON, you have to create an object or array and use JSON.stringify (available in newer browser and can be loaded form here): but you cannot just set the

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

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

PO Box Regular Expression Validation

Here’s my code, but I can’t ever trigger the alert. Answer In javascript, you have to escape your slashes: Also, you could reduce your pattern a bit by using case-insensitive matching: Note: Your regex also matches on addresses such as: 123 Poor Box Road 123 Harpo Box Street I would suggest also checking for a number in the string. Perhaps

How to wait until an element exists?

I’m working on an Extension in Chrome, and I’m wondering: what’s the best way to find out when an element comes into existence? Using plain javascript, with an interval that checks until an element exists, or does jQuery have some easy way to do this? Answer DOMNodeInserted is being deprecated, along with the other DOM mutation events, because of performance

Advertisement