DSTR3 Posted January 19, 2013 Share Posted January 19, 2013 I'm trying to load a listbox named Doggie with this script. It's in the header of my webpage. Can anyone see what I am doing wrong? Thank you. switch(n){ case "Place": $(".Doggie").load(function() $.ajax({ type: "POST", url: "place_place.php", cache: false, success: function (html) { $(".Doggie").html(html); } }); }); break; Link to comment https://forums.phpfreaks.com/topic/273361-loading-a-listbox/ Share on other sites More sharing options...
stijn0713 Posted January 19, 2013 Share Posted January 19, 2013 hard to tell from this code only. But i don't think the curly and round brackets are in the right order at the end, and your break statement is outside the switch? Link to comment https://forums.phpfreaks.com/topic/273361-loading-a-listbox/#findComment-1406965 Share on other sites More sharing options...
DSTR3 Posted January 19, 2013 Author Share Posted January 19, 2013 Switched it from load to ready and it populated the listbox. case "Place": $(document).ready(function () { $.ajax({ url: 'place_place.php', success: function (html) { $("#Doggie").html(html); }, error: function () { } }); }); break; Link to comment https://forums.phpfreaks.com/topic/273361-loading-a-listbox/#findComment-1406989 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.