Fun with jQuery – toggle() – Easy tips to visually enhance your website

Here’s a quick tip to add some cool effects with jQuery that require very little code to implement. In this example I’m going to so how use of the toggle function can make the simplest functionality and jazz it up.

.toggle()

In a nutshell, the toggle function will call the show() function if your element isn’t visible and the hide() function if it is.

  • Hamburger
  • Philly Cheese Steak
  • Taco
  • Pizza
  • Something else greasy and unhealthy

<br />
&lt;input onclick=&quot;$(&#8216;#preview1&#8242;).toggle();&quot; type=&quot;button&quot; value=&quot;Toggle My Menu&quot; /&gt;<br />

So as expected, clicking the button will toggle the menu. Now lets get a little more flashy:
› Continue reading

Share and Enjoy:
  • email
  • Print
  • PDF
  • Twitter
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Slashdot
  • Technorati
  • LinkedIn

Tags: ,

Wednesday, October 14th, 2009 JavaScript, Programming, Quick Tips, jQuery 1 Comment

Hiding Unnecessary Response Headers Apache/PHP

One way to help protect your website/server is to not tell everyone what platform and app versions everything is running on. If you were to request a php file from my site you see some response headers that could be useful to people looking to break in, cause havoc etc…

Here is my request to aknosis.com (I’m viewing all of this in Firebug, if you don’t have it get it, best web development tool in my arsenal)

Date Wed, 14 Oct 2009 05:59:59 GMT
Server Apache/2.2.3 (CentOS) PHP/5.2.9 mod_ssl/2.2.3 OpenSSL/0.9.8b
X-Powered-By PHP/5.2.9
X-Pingback http://www.aknosis.com/akwp/xmlrpc.php
Expires Wed, 11 Jan 1984 05:00:00 GMT
Last-Modified Wed, 14 Oct 2009 06:00:00 GMT
Cache-Control no-cache, must-revalidate, max-age=0
Pragma no-cache
Vary Accept-Encoding,User-Agent
Content-Encoding gzip
Content-Length 10636
Keep-Alive timeout=2, max=100
Connection Keep-Alive
Content-Type text/html; charset=UTF-8

So if I was running a known insecure version of php, apache, or any other out of date software exposed in the response headers, an attacker has to look no further to determine what you are using and how best to attack you.

Apache

› Continue reading

Share and Enjoy:
  • email
  • Print
  • PDF
  • Twitter
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Slashdot
  • Technorati
  • LinkedIn

Tags: , ,

Tuesday, October 13th, 2009 Apache, System Administration No Comments

Optimizing Website Peformance with a CDN (jQuery)

If you want to increase load times for your site a good way is to serve your resources (js/images/css) from different hosts. Even better is to use a CDN (Content Delivery Network) that has edge locations, see Amazon’s CloudFront,  that will serve those resources from hosts that are nearest to your viewers.  If it is logistcally possibly for your needs and its free is there any reason not to? Yes.

Specifically if you use jQuery on any of your sites more than likely you serve it with every page on your site, so if you want to have one less request for every page just use a free CDN to host it:  GoogleMicrosoft

A recent blog post @ elijahmanor.com explains more why you would want to do such a thing. However, a commenter on that blog post has a good point… If I point my jquery resource at one of these cdn’s how do I know that the files are being served since it is all client side? What’s worse is how much functionality is broken if jquery is 404′d from that CDN?

Well here’s a little trick that you can use verify that jQuery is loaded and how to handle it if not:

› Continue reading

Share and Enjoy:
  • email
  • Print
  • PDF
  • Twitter
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Slashdot
  • Technorati
  • LinkedIn

Tags: ,

Friday, October 2nd, 2009 JavaScript, Programming, Quick Tips No Comments

Testing Plugin Syntax Highlter Evolved

Just a quick post to test the Syntax Highlighter Evolved plugin.

<br />
&lt;?php<br />
$this = &#8216;only a test&#8217;; //ignore me<br />
$shout = new shoutOut();<br />
try {<br />
    $shout-&gt;out();<br />
} catch (Noise $n) {<br />
    $shout-&gt;whisper();<br />
}<br />

Share and Enjoy:
  • email
  • Print
  • PDF
  • Twitter
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Slashdot
  • Technorati
  • LinkedIn
Wednesday, August 12th, 2009 Programming, Ramblings 1 Comment

Make any webpage printer friendly and create pdf’s on the fly

I just noticed this was added to my sociable plugin, but I have to say it is definitely a great concept and it is one of those things that makes you wonder why it took so long to come about. I would use this any day over some browser plugin, the less crap to fill up my browser that it wasn’t intended for the better. The coolest part is being able to remove any content in the url and print your modified version of the page.

http://www.printfriendly.com/

Share and Enjoy:
  • email
  • Print
  • PDF
  • Twitter
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Slashdot
  • Technorati
  • LinkedIn
Thursday, June 4th, 2009 Ramblings No Comments

Just downloaded Pandora for my…

Just downloaded Pandora for my BlackBerry. All I can say is wow!

Share and Enjoy:
  • email
  • Print
  • PDF
  • Twitter
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Slashdot
  • Technorati
  • LinkedIn

Tags:

Saturday, May 30th, 2009 Ramblings No Comments

Post office likes to increase …

Post office likes to increase rates yet customer service is still sub par at best. Slow as fuck.

Share and Enjoy:
  • email
  • Print
  • PDF
  • Twitter
  • Digg
  • Facebook
  • MySpace
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Slashdot
  • Technorati
  • LinkedIn

Tags:

Friday, May 22nd, 2009 Ramblings No Comments

Powered by Twitter Tools