jasondavis
07-22-2009, 02:34 AM
HI I am working on a new drag and drop in jquery I have found a perfect example code to work with however it uses ASP and I am a PHP guy
Could someone who understands javasscript better change this code to send variables to a PHP file and tell me which variables to catch at the PHP end please
<script type="text/javascript">
$("#gallery").dragsort({ dragSelector: "li div", dragEnd: saveOrder });
function saveOrder() {
var serialStr = "";
$("#gallery li").each(function(i, elm) { serialStr += (i > 0 ? "|" : "") + $(elm).attr("itemID"); });
$.ajax({ url: "example.aspx/SaveListOrder", data: '{"ids":"' + serialStr + '"}', dataType: "json", type: "POST", contentType: "application/json; charset=utf-8" });
};
</script>
Could someone who understands javasscript better change this code to send variables to a PHP file and tell me which variables to catch at the PHP end please
<script type="text/javascript">
$("#gallery").dragsort({ dragSelector: "li div", dragEnd: saveOrder });
function saveOrder() {
var serialStr = "";
$("#gallery li").each(function(i, elm) { serialStr += (i > 0 ? "|" : "") + $(elm).attr("itemID"); });
$.ajax({ url: "example.aspx/SaveListOrder", data: '{"ids":"' + serialStr + '"}', dataType: "json", type: "POST", contentType: "application/json; charset=utf-8" });
};
</script>