fife Posted July 18, 2012 Share Posted July 18, 2012 I have this function that i have found and implemented. It belongs to a dual drop down an refreshes the second dropdown base on the first one. The function works fine but not when the page is first loaded. I does not show anything. I have to select an item out of the first drop down to refresh this second one into working. Is there anyway I can mkae the second one work correctly straight away? <script type="text/javascript" charset="utf-8"> function get_cities(networks) { $.ajax({ type: "POST", url: "select.php", /* The country id will be sent to this file */ beforeSend: function () { $("#folder").html("<option>Loading ...</option>"); }, data: "idnetworks="+networks, success: function(msg){ $("#folder").html(msg); } }); } </script> The function only works Link to comment https://forums.phpfreaks.com/topic/265880-function-not-running-on-page-load/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.