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 Quote Link to comment https://forums.phpfreaks.com/topic/265880-function-not-running-on-page-load/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.