One of the things I've been playing around with a lot recently is jquery. Why I didn't jump on this bandwagon sooner, I'm not sure, but I am kicking myself for it. So I am still a bit of nub on the jquery front – but I like to think I pick things up quickly. […]
Awhile back, I had a project where I created a nice clean (X)HTML page including navigation using UL and LI tags. A few months later the client decided they wanted to add a dropdown menu to the navigation. No problem, I thought. We just add the embedded lists to the navigation – style it with […]
This is probably considered "Javascript 101" – but I still had a bit of trouble finding just the right syntax to work. Simply needed a button to open a new page (in the same browser window): <input type="button" value="THERE REALLY ARE OTHER SEARCH ENGINES!" onclick="location.href='http://www.yahoo.com'; return false" />
Comments Off on Have button (input element) go to new page with onclick
Example: <div id="mydiv" class="current">Content</div> To change class assignment: document.getElementById('mydiv').className = 'notcurrent'; To remove the class assignment: document.getElementById('mydiv').className = ";
The main reason I've seen that error come up in javascripts is because a form name or field name has been misspelled somewhere. Tonight, while I combed over every name until my vision was crossed – I discovered a new reason why you might get this error: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> I was working […]
Comments Off on Warning: reference to undefined property
Just some random stuff. This post was saved as a draft a long time ago because I needed to refer to one of these – but was waiting until I could find the original source to publish. It's pretty generic/basic stuff, though, (and a really small snippet) so I'm finally posting it. To set the […]
Comments Off on Setting Form Elements (mini-cheatsheet)
I was recently asked to embed a map into a web site. Basically, the client wanted a map, with a marker, indicating where their business was, and an easy way for the user to get directions to where they were located. The first thing you need to do is get a Google Map API key. […]
I needed to set the selection of a drop down menu. As far as I can tell, if you don't know the "index" value, then you just have to loop through to set the item as selected. If there's an easier way to do this, please speak up in the comments. I spent WAY too […]
Somewhat along the same lines as this older post… I had a "purchase" page where I wanted to allow the user to either purchase items on the site via credit card, or they could choose to pay via paypal. So two buttons. One that says "Pay with Credit Card" another that says "Pay with Paypal"… […]