Кто нибудь помогите поправить код отправки комментария.
Код
$('#send').click(function(){
$.get(href, function(data) {
var tmp = href.split('-');
$.post('/index/', {
message: $('#message').val(),
subs: 0,
ssid: $('[name="ssid"]', data).val(),
sos: getSession(dat),
a: 36,
m: 1,
id: tmp[tmp.length - 1]
}, function(res) {
$('.entry', $(res).text()).prependTo('#wall');
$('#wall > div:gt(9)').remove()
//$('#wall').html('');
//wall_load()
})
})
})
Код
<script type="text/javascript">
function getSession(data){
for(var i=0,code=data.match(/_dS\('(.+)'\)/i)[1],_i=code.length-1,session='';i<_i;i++){session+=String.fromCharCode(code.charCodeAt(i)-code.substr(_i,1))};return session.match(/\d+/g)
}
</script>