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
Tag: javascript
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
Is there a way to increase the size of localStorage in Google Chrome to avoid QUOTA_EXCEEDED_ERR: DOM Exception 22
I’ve written a webapp that allows you to store the images in the localStorage until you hit save (so it works offline, if signal is poor). When the localStorage reaches 5MB Google Chrome produces an error in the javascript console log: Uncaught Error: QUOTA_EXCEEDED_ERR: DOM Exception 22 How do I increase the size of the localStorage quota on Google Chrome?
Android WebView – Setting HTML Field focus using Javascript
I have an application with just a visible WebView component to it which is used to display some dynamically generated HTML (can run Javascript too). It’s enabled for the WebView. For a few pages I am trying to set the focus of one of the input text boxes after the page load has finished – not through Body onLoad(), but
Set of objects in javascript
I’d like to have a set of objects in Javascript. That is, a data structure that contains only unique objects. Normally using properties is recommended, e.g. myset[“key”] = true. However, I need the keys to be objects. I’ve read that Javascript casts property names to strings, so I guess I can’t use myset[myobject] = true. I could use an array,
What is the difference between DOM Level 0 events vs DOM Level 2 events?
What is the difference between DOM Level 0 events vs DOM Level 2 events? I ask because I was told that Firefox and IE call them in a different order and I had never heard those terms before. Answer DOM Level 0 events were based around the concept of using element attributes or named events on DOM elements, e.g.: Or
Inmobi API for Javascript based mobile App
Has Inmobi provided API for Javascript based Mobile Application? I am writing Symbian apps using WRT (Web Runtime Widget). These apps are purely written in Javascript. Currently I am unable to find support for such apps from Inmobi. I have to integrate Inmobi ads in those apps. Is there any hack/solution available? Answer We do not have the Javascript based
strip decimal points from variable
I have a series of variables that have a decimal point and a few zeros. How do I strip the variable so it goes from 1.000 to 1? Answer Simply… …assuming you want to round 1.7 to 2. If not, use Math.floor for 1.7 to 1.
Best practice for triggering events on calling page from an ajax page
I have a page that lists a bunch of files. This page can be accessed directly via a URL or it can be loaded in a modal dialog via ajax from a different page. If the files page is loaded via ajax, I would like to allow the user to click the name of the file and trigger an action