我拿到這個劇本,這是我在網絡上找到:的jQuery - 發送字符串到PHP安全它在MySQL
<script type="text/javascript">
$(document).ready(
function() {
$('a.closeEl').bind('click', toggleContent);
$('div.groupWrapper').Sortable(
{
accept: 'groupItem',
helperclass: 'sortHelper',
activeclass : 'sortableactive',
hoverclass : 'sortablehover',
handle: 'div.itemHeader',
tolerance: 'pointer',
onChange : function(ser)
{
},
onStart : function()
{
$.iAutoscroller.start(this, document.getElementsByTagName('body'));
},
onStop : function()
{
$.iAutoscroller.stop();
}
}
);
}
);
var toggleContent = function(e)
{
var targetContent = $('div.itemContent', this.parentNode.parentNode);
if (targetContent.css('display') == 'none') {
targetContent.slideDown(300);
$(this).html('[-]');
} else {
targetContent.slideUp(300);
$(this).html('[+]');
}
return false;
};
function serialize(s)
{
serial = $.SortSerialize(s);
alert(serial.hash);
};
</script>
<div class="serializer">
<a href="#" onClick="serialize(); return false;" >serialize all lists</a>
</div>
<script language="JavaScript" type="text/javascript">var client_id = 1;</script>
在腳本的底部是「功能連載」,這是由所謂的點擊下面的鏈接。有人可以告訴我,我怎麼發送變量「serial.hash」到一個PHP文件,以將其保存在MySQL數據庫?
千恩萬謝,maschek
不要回滾編輯請。它只是被編輯來改進格式,所以腳本在多行上並突出顯示。 – Yacoby 2009-12-26 19:38:05