使用jquery ui可排序,當發生變化時,執行函數'位置'。它裏面有一個ajax的文章,但位置被觸發時,它不會發送:Ajax調用不與jQuery UI使用
$('#col').Sortable(
{
accept: 'widget',
opacity: 0.5,
helperclass: 'helper',
change: positions,
handle: '.widget_title_bar'
}
);
然而,「位置」絕對可行的,因爲當我通常把它通過一個onclick動作阿賈克斯後被髮送。我唯一能想到的是位置是用javascript編寫的,而不是用jquery編寫的。我該如何解決這個問題?
編輯我已經包括下面的位置:
function positions(){
var widgets = '';
var column = document.getElementById('col');
for(i = 0; i < col_1.childNodes.length; i++) {
var str1 = col_1.childNodes[i].className;
if(str1 && str1.match('widget')) widgets+='&c[1]['+i+']='+col_1.childNodes[i].id;
}
xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
xmlhttp.open('POST', '/positions.php', true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("widgetpositions="+widgets);
xmlhttp.send(null);
return true;
}
請向我們展示職位。 – 2011-05-29 20:28:36
嗨Dr.Molle,我已經在'職位'功能編輯到我原來的職位上面。謝謝。 – james 2011-05-29 20:39:38
函數裏面的col_1是什麼? – 2011-05-29 21:51:49