Обработка данных
- 1 ответ
- 0 вопросов
9
Вклад в тег
$routeProvider.when('/', {
templateUrl: 'partials/homepage.html',
controller: 'MyController'
});
<div ng-controller="MyController">
function getLang(lang) {
var d = $.Deferred();
$.getJSON(gInit['url'] + '/lang/'+getCookie('lang')+'.json', function(data) {
var items = [];
$.each(data, function(key, val) {
if(key == lang) {
items.push(val);
}
});
d.resolve(items);
});
return d.promise();
}
var test = getLang("users");
test.done(function (data) {
console.log(data);
});
SELECT
messages.*
FROM
messages
WHERE
messages.dialog_id = 3
AND
messages.id NOT IN (
SELECT deletes.message_id FROM deletes WHERE deletes.login = 'vasya'
)
<form action="send_path" method="POST">
<input type="text" name="name" value="">
<input type="text" name="phone" value="">
...
<button type="sumbit">Send</button>
</form>
$('form').on('click', 'button[type="submit"]', function (e) {
var form = $(e.currentTarget).closest('form'),
name = form.find('input[name="name"]').val();
...
$.ajax({
url: form.attr('action'),
type: form.attr('method'),
...
});
});