Архив

Публикации с меткой ‘javascript’

How to disable "Enter Key" to submit?

26 Ноябрь 2008 Нет комментариев

<form action=»foo»>
<input type=»text» onkeypress=»return bar(event)»>
<input type=»submit»>
</form>

<script type=»text/javascript»>
function bar(evt){
var k=evt.keyCode||evt.which;
return k!=13;
}
</script>

Note however that this «enter» key behavior isn’t standard (and actually behaves differently across user agents); moreover this won’t prevent you from full server-side checking, as a client can have javascript deactivated (or even trick your javascript at runtime).

Categories: Новости Tags: ,

PHP function for make JSON

PHP function for make JSON from array

Читать далее…

easy sort table with javascript

20 Август 2008 Нет комментариев

Скрипт сортировки данных в таблице с помощью JavaScript.

Читать далее…

foreach in JavaScript

Actually that’s not true at all.
As all javascript objects are really just associative arrays, there is a foreach like syntax for the ‘for’ construct.
Without it it would be very hard to work with many common javascript objects.
It’s actually very simple to use and incredibly useful if you like associative arrays.

You just have to make sure to use it on an associative array and not an object.
Example below

Читать далее…

Show, hide, toggle element in javascript

Categories: Новости Tags:

библиотеки ajax

Куча готовых ajax решений.

http://ajaxrain.com/

Categories: Новости Tags: , ,