Toby's Development Blog Just another PHP / Javascript Developer

27Nov/093

InFrame – Dynamic iFrame creation with jQuery

jQuery spends a lot of time impressing the shit out of me, one example of it doing it recently is with Vile Work's inFrame (one person has reported an issue with this site and viruses, I cannot replicate though.).

What this plugin does is capture any links containing a certain class and instead of having them display in the current window it will create an iFrame on the fly for the content to display into.

We all know that iFrames are bad because they hide stuff from crawlers and different accessibility tools, however one of the really smart things about this is that because it looks for links of a certain class anyone coming along without JavaScript installed (say, a search engine for example) will just follow the link as normal with no negative effect.

I can see loads of potential uses for this tool and look forward to playing with it in an actual project.

Here is it in action.

Is twitter up?

Cool, huh?

  • Digg
  • Delicious
  • Facebook
  • Reddit
  • Ping
  • Twitter
  • Share/Save/Bookmark
24Nov/092

Online resources for web development

Here are a selection of online resources that I use when developing.  Some I use far too often, and some I have to say I use far too little!

This list is by no means comprehensive, and I will be updating it over time.

I am always on the look out for new sites like these, so please feel free to comment this post with your suggestions.

codingforums.com
I am a bit of a sucker for forums and have found this one to have a good bunch of people behind it, they are willing to help and very welcoming.

php.net
Self explanatory really, the docs on this site tell you how each and every PHP method should be used with some excellent community based examples.

stackoverflow.com
Think of a free version of Experts Exchange aimed directly at programmers and about 10 times better, that is what Stack Overflow is.  Sign up for a free account and ask questions (from the very very simple, to the very very complex, all levels are catered for).

tizag.com
A very basic tutorial website covering a range of languages, for when you have a bit of a brain freeze and know the solution is way too simple to ask for help!

validator.w3.org
Valid HTML is happy HTML (you can also validate your CSS there too).

w3schools.com
Much like Tizag only much more established.

  • Digg
  • Delicious
  • Facebook
  • Reddit
  • Ping
  • Twitter
  • Share/Save/Bookmark
19Nov/091

Exploring Built In Functions

ScreenshotAn issue I have been pondering lately is how much time to dedicate to trawling through programming language manuals and doc files looking for built in functions to perform a particular task.

Obviously there are some functions that you can pretty much take for granted will be provided for by the language, an example would be returning the size of the array.  We know that each language might have slightly different terminology for performing this basic task but we also know it should be there and is most likely going to be easy to find - a very quick google will tell you what you need to know and you can carry on with your life.

But what about some of the more fiddly functions?  An example would be the large array*1 of functions you can call in PHP to do some fairly cool stuff to arrays and I know that the majority of these functions are not going to be available in say JavaScript.  Normally I would have a quick google and if nothing immediately jumps out at me and I know I have a rough idea of how to recreate this bit of code then I will just go ahead and write it myself.  I think there are a few pros and cons to what I do.

Pros;

  • I get to think about the best way to make these functions.
  • I get to create the function exactly how I want.
  • I get to create!
  • I am not wasting time searching for something that may not exist.

Cons;

  • It is generally going to be slower to write it from scratch than it would be to spend some more time digging about to find the appropriate function.
  • I am not fully getting my teeth into the language or taking benefit from its internal libraries.
  • If there is an in built method already in place, I am sure it is going to be far more optimised for the task than my method is*2

Lets now say that we have looked through the manual for the language and done some googling and we are pretty confident that a function doesn't exist natively, it seems to me that we then have a couple of choices; we can see if someone else has created similar methods/libraries/functions or we can create them ourselves.  Obviously there are pros and cons to finding someone else's.

Pros;

  • Can be quicker.
  • Already documented.
  • Sometimes there is community support

Cons;

  • It will never do 100% what you want it to do.
  • You will never learn how to solve the problem for yourself (but if there is a solution, then is it worth you solving it again?)

The pros and cons for creating it yourself is pretty much the reverse of the above!

I guess what I am asking, in a rather round about way, is how much time do you spending searching for a pre-built solution against writing your own?

*1 - Do you see what I did there? An array of functions? Har har har!!
*2 - Actually, I am not convinced this is true, most in built functions have to be fairly generic, I can streamline my functions to do what I want them to do, but for example I know that creating a function to return the size of an array is going to be less efficient at run time than using sizeof(), no matter what awesome stuff I do within that method.

  • Digg
  • Delicious
  • Facebook
  • Reddit
  • Ping
  • Twitter
  • Share/Save/Bookmark
5Sep/093

Damn this guy can wireframe!

Wireframing is something that both designers and developers should really learn how to do well, a good wireframe could potentially save you a lot of time when it comes to immediately chucking out bad ideas and it also helps to bring the client in early on in the process. Knocking up a wireframe (as you are about to see) can be an incredibly quick task and it gives you something you can take to the client for early feedback and opinion.

There are plenty of tools out there for wireframing, my personal choice is Balsamiq; whilst it has been dismissed by a lot of designers due to the childish nature of the sketches I love it because as a complete novice at design I can quickly and easily put my thoughts onto paper.

Anyway, watch this video and be impressed at the speed at which Clay Parker Jones has knocked out this design (and enjoy the music too, nothing wrong with a bit of MJ!)

How to Wireframe from Clay Parker Jones on Vimeo.

Thanks to Designbit for posting this video originally.

  • Digg
  • Delicious
  • Facebook
  • Reddit
  • Ping
  • Twitter
  • Share/Save/Bookmark
6Aug/090

Browser History Fix (Ajax)

Anyone who has developed a website that uses AJAX for a large chunk of the site will know the fear of the user hitting the back button when they really shouldn't be (damn crazy users, thinking they can just do stuff whenever they feel like it!)

Hopefully this small script that came from Martin Ivonov's Blog will calm some of that fear.

I haven't had chance to properly play with the code yet, but it looks very promising and could take away a lot of headaches in the future.  When I do get time to have a proper play, I will post up the results.

  • Digg
  • Delicious
  • Facebook
  • Reddit
  • Ping
  • Twitter
  • Share/Save/Bookmark

Hello

I am a PHP and JavaScript developer who works for Team Solutionz.

This website is what I use to talk about things most of my friends don't want me to talk about to them! For some reason they find coding alien and boring... I have strange friends.

Subscribe via RSS

New Posts

Old Posts

Categories

Links

Other Links

Sign Up and Comment!

What I talk about