Developer // Accessing WordPress URL Function Values Within Javascript

During my custom WordPress theme development I often find that it would be really useful if I could just use the WordPress get_template_directory_uri() or home_url() functions from within Javascript.

For example when trying to set the url of an Ajax request in jQuery, or setting the path to an icon image file on a Google Map.

Thankfully, if you’re using WordPress in the way it’s intended, there is a very simple way to make this possible. Continue reading “Developer // Accessing WordPress URL Function Values Within Javascript”

Google reCaptcha

google recaptcha

Google’s very own captcha tool ‘reCAPTCHA‘ has been launched and looks like it will make a lot of users lives much easy when it comes to data capture.

Not only is it a much nicer visual experience for the user,  it also speeds up data entry – as in a large number of cases it will be as simple as ticking a box to say you are not a robot to complete the form, and is mobile friendly too. Continue reading “Google reCaptcha”

Nesting an onclick within an onclick

When trying to place an onclick function on a link in a table cell, which is part of a row which also has an onclick event, leads to both onclick functions being called.

After looking into how to go around this issue I used

This worked perfectly, stopping the parent onclick from firing, but when it came to testing in dreaded IE I found it wasn’t supported.

So I tried changing to:

This works just as well, not only in Firefox but IE too.

Continue reading “Nesting an onclick within an onclick”