Posted by David G. Paul
Different browsers have different implementations of JavaScript. It's pretty common having to detect IE and to do something different for it, and in the case of WYSIWYG editors such as Xinha you also have to have ways of detecting Safari, and Opera as well as browser versions. Since Google's Chrome browser using the V8 JavaScript Engine you may find you need to tweak the odd few lines to work differently in that - and to do that you're likely going to want a way of detecting the browser. If we look at the User-Agent sent from the browser, we have:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13
So all we need to do is check for the presence of Chrome in the User-Agent.
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
Remember though that it's not foolproof - people can spoof their User-Agent.
continue reading this post...
Posted by David G. Paul
Browsing around today, I came across a potentially useful library. If you're run, or are going to build a website that delivers MP3 content to visitors, such as MP3's of podcasts, etc. then you're likely going to want a "landing page" for the content to describe what the MP3 is about. With this JavaScript library I found today it could speed this process up by reading the contents of ID3v2 tags so that you can do as you will with this information. Apparently this is based on code that is used to read EXIF data from JPEGs taken from digital cameras. Both of these are definitely useful for media sites.
continue reading this post...
Posted by David G. Paul
The current nightly build of Firefox has made a bit of noise around the internet in certain circles due to the new optimisation techniques Mozilla are using to greatly increase the performance of JavaScript. Previously, performance concerns have often been mentioned with regards to Firefox, but now it looks like at least once performance issue will no longer be a problem in Firefox 3.1 when it is released.
Ars Technica has posted a number of graphs indicating the performance differences between "Tracemonkey" and Firefox 3 when using various JavaScript. One example of the improvement is for function calls. If Firefox 3 was benchmarked at 1.0, then Tracemonkey is 26 times faster. I'd say that's pretty impressive, but when you look at the performance increase for global loops it's even better!
continue reading this post...
Posted by David G. Paul
I always planned on writing a proper review of jQuery and jQuery UI but have still to get round to it. In the meantime though, those developers have gone and created an updated version of jQuery UI that contains the following changes:
- Interaction
- Draggable
- Add an event to the droppable system. [2436]
- ui.absolutePosition not updated when snapping is enabled [3002]
- Draggable: make revert a method [2914]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Droppable
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Resizable
- Resizable jumps when in scrolled container. [3074]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Selectable
- [UI] ui parameter in callbacks/events should be consistent [2545]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Sortable
- sortable element disappear after drag and double click [2945]
- Add a hook in sortables to generate the list of sortables [2729]
- [UI] ui parameter in callbacks/events should be consistent [2545]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Widgets
- Accordion
- Accordion: dispatched events have incorrect parameters [3036]
- [UI] ui parameter in callbacks/events should be consistent [2545]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Datepicker
- Bug in jQuery datepicker [3072]
- duration or speed [3050]
- catalan localisation. [3041]
- firstDay for swedish locale [3033]
- UI.datepicker custom cell renderer [2538]
- datepicker to support unicode.org date formats [2044]
- DatePicker in UI 1.5.1 does not cancel button click [3047]
- [UI] ui parameter in callbacks/events should be consistent [2545]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Dialog
- Wrong cursor in dialog title when draggable is false [3066 ]
- dialog buttons not visible without a theme file [3061]
- cannot select text in dialog content [3059]
- Make activate() in ui.dialog, public. [2728]
- Dialog causing iframe load event to fire in firefox 2 [3012]
- [UI] ui parameter in callbacks/events should be consistent [2545]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Slider
- blue dot on ui-slider (Firefox 3) [3029]
- animation in Slider [2978]
- ui-slider: Allow cursor to be changed while dragging slider [2854]
- Slider handle focus border [2949]
- [UI] ui parameter in callbacks/events should be consistent [2545]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Tabs
- Tabs: dispatched events have incorrect parameters [3035]
- Binding handler to 'tabsselect': ui undefined [3063]
- [UI] ui parameter in callbacks/events should be consistent [2545]
- Safari 3.1.1 $jq.remove() losing select options [3037]
- Effects
- Slide
- Slide up/down in IE7 [2952]
If you use jQuery UI then you should really go and try it out! One thing I should also say is that I really do like their new site design - I didn't actually notice before now that they'd redesigned it.
Link: jQuery UI 1.5.2
continue reading this post...
- JavaScript debugging in IE8
The ability to debug JavaScript (known as JScript in the Microsoft implementation of it) has always been troublesome in Internet... (Read more)
- Prototype updated to 1.6.0.2
Prototype has had quite a few fixes in the new 1.6.02 update - so many in fact that... (Read more)
- jQuery updated to 1.2.2
There hasn't been that much web development news so far this year that has been worth posting about; though recently... (Read more)
- EditArea - JavaScript Sourcecode Editor
Barely into the new year and already I'm finding little time for posting here. Today I read a post... (Read more)
- A Jackel to Query
I imagine you've probably heard of JSON before if you've done much with JavaScript and Ajax.... (Read more)
- Plotting on your Site
Graphs make boring numbers look pretty - there's no denying it. Graphs though tend to be hard to create... (Read more)