Hallo Community,
ich habe einen PHP-Array:
Diesen würde ich gerne in das JQery-Script überführen und war so, dass wenn ich eine neues PHP-Array hinzufüge dies automatisch in das jQuery-Script einfügt. Ich gehe davon aus, dass dies über eine for-Schleife gelöst werden kann. Auch wie ich den PHP-Array in jQuery bekomme ich mir nicht klar...
Leider habe ich in JS keine Erfahrung und hoffe Du kannst mir helfen...
ich habe einen PHP-Array:
Code:
array(3) { [0]=> string(4) "todo" [1]=> string(10) "inprogress" [2]=> string(9) "completed" }
Leider habe ich in JS keine Erfahrung und hoffe Du kannst mir helfen...
Code:
<script> $(document).ready(function () { $("#todo, #inprogress, #completed").sortable({ connectWith: ".connectList", update: function (event, ui) { var todo = $("#todo").sortable("toArray"); var inprogress = $("#inprogress").sortable("toArray"); var completed = $("#completed").sortable("toArray"); $('.output').html("ToDo: " + window.JSON.stringify(todo) + "<br/>" + "In Progress: " + window.JSON.stringify(inprogress) + "<br/>" + "Completed: " + window.JSON.stringify(completed)); }); } }).disableSelection(); }); </script>
Kommentar