Entries Tagged as "jQuery + Javascript"

Javascript dateDiff function

I needed a function to check the difference between 2 dates in javascript. I couldn't find a suitable one, so I created this one:

function dateDiff(datepart, fromdate, todate)// datepart: 'w', 'd', 'h', 'n', 's'
{
datepart = datepart.toLowerCase();
var diff = todate - fromdate;
var divideBy = {
w:604800000 //1000*60*60*24*7
, d:86400000 // 1000*60*60*24
, h:3600000 // 1000*60*60
, n:60000 // 1000*60
, s:1000
};
return Math.floor(diff/divideBy[datepart]);
}

2 Comments

CKeditor 3 with free filemanager, now also for Coldfusion! v1.1.2

I always used version 2 of the best wysiwyg editor out there: FCKeditor. But it began to show it's age, and some functions didn't work like I wanted. So I checked for an upgrade. And yes, did they have one! A completely rewritten editor, now dubbed CKeditor, created by CKsource.com. It looks good, works good, and was easy to integrate.
But because you have to pay for the filemanager, and there is a free alternative, I created the CFM connector for CKeditor's alternative Filemanager!

30 Comments

Test for existence of the Cortona 3D plugin

If you want to check whether your visitor has the Cortona 3D viewer plugin installed in the browser, you can use the following javascript:

No Comments

Mangoblog plugin: viewCount v1.4 - updated 10 august 2010

Wouldn't you like to know how many people have read your blog post? Well, I do like so. In the blog system mangoBlog, which I use for this weblog, this wasn't a default option, and there wasn't a plugin yet to add this.

So, I created the Viewcount plugin. It shows the text "View count: xx" underneath this post...

18 Comments

A recursive jQuery.toJson() function

I created a javascript toJson() function, which recursively converts any javascript object to json (javascript object notation).
The function relies on jQuery, and is added to the main jQuery object '$'. So, you can call $.toJSON(obj).

No Comments