Javascript's tag archives

Move copy delete options between Select Menus with Javascript

This javascript snippets perform certain tasks like select one or more of the options, move them or copy or delete between two select menus. You can bookmark the article and use the code whenever you need them. Click here for the online demo.

Sorting a two dimensional array in javascript

Sorting arrays in JavaScript is done via the method array.sort(). Passing in a function reference into array.sort() As touched on already, array.sort() accepts an optional parameter in the form of a function reference (lets call it sortfunction). The format of this function looks like this: When such a function is passed into array.sort(), the array elements are sorted based on the relationship between each pair of elements "a" and "b" and the function's return value. The three poss...

20 Tools to Improve Your Website’s Usability

Usability testing is test conducted to collect feedback and information from your website’s visitors or regular readers that can be very useful for future website revamp, enhancement or other adjustments. Designers and developers may have created websites according to specifications, but ultimately it is the users who will decide its creditability (how far it is usable), the highlights of the site and what does it lack of. How to know whether a visitor likes your website? Usability ...

ThinkPHP示例之 字段映射

要使用模型的自动创建create方法的话,ThinkPHP的表单名称就是数据表的字段名称,如果担心这样不够安全,可以定义字段映射,来隐藏实际的数据表字段名称。 下面的例子就运用了字段映射定义。请注意看表单名称和字段的对应关系。 标题: 邮箱: 内容: 验证码: 输入对应的数字 示例源码 控制器IndexAction类 模型 FormModel 类

Pass variable to javascript use javascript

Client wants add following tracking code on website: To ensure accurate tracking, they want [CACHEBUSTER] can be replaced by a Time Stamp when page reload. This is the way we use:

How to use the W3C Geolocation API

Introduction Imagine visiting a city for the first time. You're hungry, but don't know where the nearest restaurants are and which of them are any good. Wouldn't it be nice if some app could detect your location and provide you with a list of restaurants closest to you, along with reviews and ratings for each one? And this is not the only consideration — could it detect your location accurately, keeping in mind your privacy as well? This is where the W3C Geolocation API comes in, suppo...

10+ useful codes for develop iPhone friendly websites

Detect iPhones and iPods using Javascript When developing for the iPhone and the iPod Touch, the first thing we have to do is obviously detect it, so we can apply specific code or styles to it. The following code snippets will detect iPhones and iPods using Javascript, and redirect those users to an iPhone specific page. Detect iPhones and iPods using PHP Although the previous snippet works great, Javascript can be disabled on the iPhone. For this reason, you may prefer to use...

50 Powerful Time-Savers For Web Designers

Being a web designer is not easy. Not only do we need to have a good understanding about visual design, typography, information architecture, psychology and a plethora of other disciplines; in our work, we need to take care of so many details, so that our job becomes more and more time-consuming, requiring dozens of tools, attention span and an effective workflow for beautiful, timely and functional results. And this is where small time-savers become handy. Be it a handy checklist, batch inst...

css min/max-width fix in IE6

We can use Javascript expression in css to make sure the min-width, max-width that works for IE6.

Free download javascript slideshow

Download javascript slideshow here