Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Friday, May 22, 2015

More organized javascript

I do a lot of writing in Python and everything seems to be nicely arranged and easy to follow and then I go to what I've written in Javascript and jQuery and it looks like a mess.  It's comparatively hard to follow even much smaller tracts of code.

So here are a couple of resources on organizing Javascript code.
 
http://alistapart.com/article/the-design-of-code-organizing-javascript
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
http://rmurphey.com/blog/2009/10/15/using-objects-to-organize-your-code/

Monday, January 26, 2015

Nice set of instructions for speeding up your web pages

Today I was testing my site and I realized that one of the CDNs I was using was hanging.  Not wanting my website to be at the mercy of more failure points than necessary, I brought the hosted jQuery and Bootstrap files in house. 

The result was a surprise: good speed on Chrome but slow on Firefox.

Anyway, I found a nice resource on speeding up a web page with at lot of details that I hadn't learned before:

http://www.sitepoint.com/complete-guide-reducing-page-weight/

One interesting thing is that browsers have a limit for how many web requests they will make to one server at a time.  It's possible that it was this that made the difference between page load times on Firefox and Chrome.  It's a good argument for compiling all your CSS and JS together into one file each per page.


jqueryui and mobile: thanks TouchPunch!

I was pretty proud of my implementation of jqueryui sortable lists.  Then I went to try it on my phone and it failed. 

At first I thought it might be a javascript problem, but thinking about it I realized that the problem is that phones don't have a way to drag and drop using your mouse button.

Anyway, TouchPunch maps touch events to mouse events in a way that makes "sortable" work.  I'm pretty happy with the results.

http://touchpunch.furf.com/

Saturday, January 24, 2015

Focusing on the fundamentals

I've been looking for the next text to go through.  Today I happened on what looks like a nice one, focused on a lot of fundamentals related to what I'm doing right now.  Here's the link:

http://chimera.labs.oreilly.com/books/1234000000754/pr01.html#_outline