<span onclick="clickHandler()" class="loadvid2">МУЗТВ Онлайн ></span>
function clickHandler(){
// Событие 1
setTimeout(function(){
// Событие 2, через 5 секунд
}, 5000);
return false;
}
$('.my_input').keyup( function() {
var $this = $(this);
var v = parseInt($this.val(), 10);
if(v >= 100000)
{
$('.my_div').show();
}
});
$scope.getTotalAmount = function(index){
//тут посложнее логика
if(!$scope.billings.$resolved)
return 0;
return $scope.billings[index].bills;
}
$scope.getTotalAmount = function(index){
//тут посложнее логика
if(!$scope.billings[index])
return 0;
return $scope.billings[index].bills;
}
function getTotal() {
return $scope.customers.length;
}
jQuery( html [, ownerDocument ] )
Description: Creates DOM elements on the fly from the provided string of raw HTML.
Почему когда counter() вставить в $('.txt').on('click'...) - не работает?
function makeCounter() {
var currentCount = 0;
return function() {
return ++currentCount;
};
}
var counter = makeCounter();
$('.txt').on('click', function(){
console.log($(this).text());
counter();
});
$(function(){
var $lastClicked;
$('.txt').on('click', function(){
$lastClicked = $(this);
});
});
<?=$leftMenu[0]['link']?>
$sce is included by default starting with angular 1.2
нужно получить всех пользователей, у которых есть диалог с данным пользователем
SELECT u.*
FROM users u
WHERE
(
u.id IN (SELECT user_one FROM dialogs WHERE user_two=ID_ПОЛЬЗОВАТЕЛЯ)
OR
u.id IN (SELECT user_two FROM dialogs WHERE user_one=ID_ПОЛЬЗОВАТЕЛЯ)
)
SELECT LAST_INSERT_ID()
The ID that was generated is maintained in the server on a per-connection basis. This means that the value returned by the function to a given client is the first AUTO_INCREMENT value generated for most recent statement affecting an AUTO_INCREMENT column by that client. This value cannot be affected by other clients, even if they generate AUTO_INCREMENT values of their own. This behavior ensures that each client can retrieve its own ID without concern for the activity of other clients, and without the need for locks or transactions.
A UUID is designed as a number that is globally unique in space and time. Two calls to UUID() are expected to generate two different values, even if these calls are performed on two separate computers that are not connected to each other.
110E8400-E29B-11D4-A716-446655440000
110E8400E29B11D4A716446655440000
UNHEX("110E8400E29B11D4A716446655440000")
HEX(field_binary)
return false;
<form id="form" action="/cart/add" method="post">
<input type="hidden" value="15>" name="articleId" />
<button type="submit">В корзину</button>
</form>
$(function(){
$('#form').submit(function(e) {
var $this = $(this);
var data = {};
$this.find('input').each(function(){
var $el = $(this);
var key = $el.attr('name');
if(key)
data[key] = $el.val();
});
$.post($this.attr('action'),data)
.done(function(r){
console.log('good call back');
})
.fail(function(r){
console.log('bad call back');
});
e.preventDefault();
return false;
});
});
jQuery.fn.extend({
myFormSubmit: function(o){
var opts = {
doneCb: function() {},
failCb: function() {}
};
opts = $.extend(opts,o);
return this.each(function(){
$(this).submit(function(e) {
var $this = $(this);
var data = {};
$this.find('input').each(function(){
var $el = $(this);
var key = $el.attr('name');
if(key)
data[key] = $el.val();
});
$.post($this.attr('action'),data)
.done(opts.doneCb)
.fail(opts.failCb);
e.preventDefault();
return false;
});
});
}
});
$(function(){
$('#form').myFormSubmit({
doneCb: function(r){
console.log('good call back');
},
failCb: function(r){
console.log('bad call back');
}
});
});
{
...
"scripts": {
...
"start": "http-server -a localhost -p 8000 -c-1",
...
}
...
}
function(){
btn_status = 'номер_кнопки';
}
switch(btn_status){
// ..
}
btn_3.onclick = function(){
btn_status = '3';
}
$(btn_3).click(function(){
btn_status = '3';
});
$(btn_3).click(function(){
btn_status = '3';
$(this).css({
marginLeft : '5px'
});
});