jquery



14 May 10

Today I came across a JSON file, hmm… I love the opportunities that JSON gives you as a developer, but it is very compressed and not especially human friendly. Unlike XML, which on the other hand calls for a lot of coding inside a program to convert it into anything other that just data. JSON can contain actual code, functions, objects and ofcause data.

I then googled for JSON viewer and found a very cool tool! “JSON viewer” at codeplex.com. It comes in three variants:

  1. A standalone viewer – JsonView.exe (view example screenshoot)
    No doubt – I found this very easy to use. Click to start, paste JSON and view it…
  2. A plugin for Fiddler 2 (http://www.fiddler2.com/) – FiddlerJsonViewer.dll
    Well, I do not have it installed.
  3. A visualizer for Visual Studio 2005 – JsonVisualizer.dll
    I followed the instructions (though in VS2008), but never really got to a point where I saw the visualizer appear. Perhaps I just dont get the concept of visualizer.

I will not go any further into how to install it, I believe that the readme.txt inside the ZIP file should explain that part. And how to use it – well, try downloading this JSON: http://www.netsi.dk/wordpress/wp-content/uploads/2010/05/exampleJSON.js and play around with it!


Filed under: Code, jquery

Trackback Uri






21 Feb 10

The javascript API jQuery is a very powerfull libray which have revolutionised the use of clientside javascript in browsers. Along the side of jQuery exists jQuery UI a library of strongly customizable widgets. It offers a wide range of "easy-to-implement" widgets for your website. I will try in this post to implement a datepicker and conclude in the end if it is easy!

Read the article and post your comments here on this page.


Filed under: Is it easy?, css, jquery

Trackback Uri






9 Feb 10

When I first saw that Microsoft Visual Studio 2008 (VS2008) started to allow for intellisence on javascript I was happy! Not many seconds after that my suspicious old mind saw some problems, one of them was the fact that the vast amount of documentation would follow the javascript files making them too big and slow down pages using them.

The intellisense got smarter!

The way that the intellisense got smarter is that VS2008 allows you to have the documentation in a seperate file. That way your main code will not be “heavy” for browsers to use – only at development time will the “-vsdoc” documentation file be used!

VS2008 will search for documentation in 3 predefined files – 3 patterns will be searched for: If you have a library, say "mylibrary.js", VS2008 will search for documentation in the same directory in this order

  1. "mylibrary-vsdoc.js", then if that is not found, a search for…
  2. "mylibrary.debug.js", then if that is not found, a search for…
  3. "mylibrary.js"

So if you program a javascript library you can add VS2008 intellisense code in a version named in one of the two ways shown above (or embedded in the main library), and then save it in the same folder as the actual library. This will introduce help on methodes in the library.

If no intellisence appers as you type try updating: “Edit > IntelliSense > Update Javascript IntelliSence (Ctrl+Shift+J)”.

To get this feature you will need to install this hotfix for VS2008.

You can see a description of how to use the "-vsdoc" part in jQuery here:
Rich IntelliSense for jQuery.

Below you can find links to related posts/articles – one of them “The format for JavaScript doc comments” I thing is very important as it is a guide to how you add documentation (and intellisence) to your own javascript code. So now there are more than one argument to start documenting your code!

Happy documenting!

/Sten

Related articles


Filed under: Code, jquery

Trackback Uri






14 Nov 09

Since I first started to juse jQuery javascript API I have been a happy programmer! Things like cross browser, easy widget implementation and animation were suddently very easy to use. It was fast to implement, ran fast and as mentioned were rock solid accross browsers on various platforms! Finally: It started a trend of worldwide unity amoung javascript developers – people very moving as a group.

Javascript frameworks – a litle background
Last year Microsoft realized that jQuery was a very powerfull and solid javascript framework, the simply decided to adapt it and use it as their prefered javascript API. Not a thing which done often by such a big player! The company which perhaps has as many people who hate it as it has followers realized that open source code is something to respect and adapt!

Google Colsure on the other hand – what is it? As I understand the framework is something which Google has developed for internal use, and now has opened up, so that everyone are free to use it. I must admit that I am not totally into all the terms of use and the history of this framework. However IMHO:

We don’t need Google to put one more player on the field of javascript frameworks! When it comes to javascript frameworks we need the unity amoung javascript developers – and a framework like jQuery provides all the extensibility for any Google special needs. 

What to do with “the new Microsoft” :-) ?
It would be unrealistic to expect Google to “drop” its Google Colsure framework, but us – the javascript developers – might put presure on Google (the new Microsoft?). I for one do not need another javascript framework. So I will continue using jQuery.

I do not see Google as the new Microsoft – and Microsoft is not a bad company in my eyes. What however is bad is when one company is too big and can ignore other players without getting into trouble. Google is probertly not trying to push other javascript frameworks out of the field… Right Google? :-) Perhaps Google could try to convert their ideas into extentions/plug-ins to jQuery?

Other opinions about Google Closure
Using TweetDesk I set up a search for “Closure Library” to follow the tweets about the Google Closure Library. Just followed one of them to: http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/

image

That article was written by Kevin Yank and he referes to some Google Colsure critism spoken by Dmitry Baranovskiy. I myself have coded many lines of javascript and learned things just by reading this article! I also saw some scary “mistakes” which Dmitry pointed out in the new Google Closure framework. One of them was testing if a var was of the type String (From base.js, line 742):

1
2
3
goog.isString = function(val) {
  return typeof val == 'string';
};


The problem with that method (isString) is simply that it fails if you call it with a String object! Not cool! If you call it like this: goog.isString(new String(‘My string’)) it will return false!

Ofcause nothing is perfect, and the points by Dmitry Baranovskiy could easily be changed as a normal bug is fixed in any javascript framework. What scares me is the fact that many people seem to think that Google equals perfect, and if many people are non-sceptical about things developed by Google (Yahoo, Microsoft or anyone!) then perhaps they will leave jQuery and start using Google Colsure Library… I hope not!


Filed under: jquery

Trackback Uri






16 Aug 09

You probertly know Google Maps and the API allowing you to embed maps with your information shown on the map. Google also offers a simpel API which allows you to plot simple maps just using an URL. The URL then has some parameters specifying things like zoom level, type of map and center of it.

Though simpel to setup – those parameters – I have made a simple web application which will give you the URL you need to get the map you want.

Try it here: http://www.netsi.dk/showcases/getmap.html

image


Filed under: Code, jquery

Trackback Uri






22 Jun 09

Development in the javascript area suca a serious APIs like jQuery and Prototype, makes development and use in general of javascript easier! It makes javascript a serious part of many webpages. Javascript also often play a key part in gadgets. And why not?

Javascript spans accross various technologies, has many open-source initiatives related to it and handles modern things like AJAX and XML. This morning I stumbled into yet another great article on www.smashingmagazine.com. Its called “50 fresh javascript tools that will improve your workflow” – go and visit it! I am sure that you will be inspired!

One of the points in this article is about a way of browsing your objects in a very visually nice way. Here is an example of what you may see if you “look into” one of your javascript objects:

image

“Prettyprint for javascript” – http://james.padolsey.com/javascript/prettyprint-for-javascript/

So no-more “document.write(myObject)” which would just write “[Object object]” :-)


Filed under: Code, inspirovation, jquery

Trackback Uri






11 Jun 09

10 most Useful resources for jQuery across the web
http://www.techartifact.com/blogs/2009/06/10-most-usefull-resources-jquery.html

The 20 Most Practical and Creative Uses of jQuery
http://net.tutsplus.com/articles/web-roundups/the-20-most-practical-and-creative-uses-of-jquery/


Filed under: jquery

Trackback Uri






11 Jun 09

David Walsh logo?

My respect goes to this young man – David Walsh! I love his blog/site and the words which he says about just making sites work is very nice. So go visit his blog and be inspired!

He has a lot of useful information for people working with the internet – JQuery and other information.


Filed under: Code, jquery

Trackback Uri






8 May 09

Sometimes when you see an interesting effect on a site you do a “view source” to find out how the effect was accieved. You are probertly qurious about which javascript library were used to – Library Detector plug-in for firefox will find out which libraries a site uses for you!

It seems relevant if you as me work with implementing websites, so I am happy that crawled by this site – where Library dectector plug-in for firefox came to my attention.


Filed under: jquery

Trackback Uri