November 2nd, 2009
Filed under: Food for thought |
No Comments »
Three easy steps to making your own jQuery bookmarklet, allowing you to dynamically inject jQuery into any page on the internet.
- Make a new bookmark in your browser, name it “Inject jQuery”
- Copy and paste this code into the “location” of the bookmarklet:
javascript:var%20s=document.createElement('script');s.setAttribute('src',%20'http://jquery.com/src/jquery-latest.js');document.getElementsByTagName('body')[0].appendChild(s);alert('jQuerified');void(s);
- Save the bookmark.
Now all you have to do is click the bookmark whenever you want to use jQuery on a page. This is useful if you want to try different javascript effects on the fly during web-development. You can test it from the Firebug console:
$("p").hide("slow");
This code should hide all the paragraph elements with an animated effect.
July 20th, 2009
Filed under: Development, Food for thought |
10 Comments »
So after several hours of painstaking research and trial and error I finally figured out how to make the Google Data API work with Godaddy servers. The problem lies in that godaddy tunnels all of it’s encrypted SSL traffic through a proxy server. There are various solutions and “hacks” available, but it seems that these are no longer necessary to get it working, probably because Zend has upgraded the code to support this. Some speculate that the feature was added because Google is partnered with Godaddy on a few fronts, but regardless, this is a good thing for Godaddy developers (which I routinely am, but I do not favor them).
Reference to a ‘hack’ to get Gdata working with godaddy (This is no longer needed!): http://www.ehartwell.com/InfoDabble/HowTo:_Use_the_Zend_Framework_GData_Google_Data_API_on_GoDaddy_servers
You can connect from godaddy now by using the Gdata API’s built in proxy support. Here’s how to do it!
- First upload your Google Gdata API directory to your web server, wherever you feel necessary.
- Create a new php file (test.php) or something to use as a testbed for your API.
- Copy the source code from this file into test.php, and modify the username and password for the Gdata connection, as well as the include path for your Gdata install.
- Test it by running it. Modify to fit your needs (Use the API documentation)