mike1313 Posted December 5, 2007 Share Posted December 5, 2007 Is it all all possible to get both the CloseMessage(); and displayMessage(); to work on the same onclick event? <a href=# onclick=closeMessage()&&displayMessage('page.php');return false>Add</a> All I know is that it doesn't work as is. Any help is appreciated. Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 5, 2007 Share Posted December 5, 2007 Yes use a semi-colin as you did with the return statement <a href="#" onclick="closeMessage();displayMessage('page.php');return false">Add</a> Quote Link to comment Share on other sites More sharing options...
mike1313 Posted December 5, 2007 Author Share Posted December 5, 2007 Alright is there an alternative method? Because sadly that still does not work. Also both the closeMessage() and displayMessage() work apart from one another but once I combine them. Nothing. Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 5, 2007 Share Posted December 5, 2007 can you post your code ? what are you trying to acheive from these functions Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 6, 2007 Share Posted December 6, 2007 encapsulate both functions into one and use a setTimeout for each function. like so: <script language="javascript"> function closeMessage() { // functions contents here } function displayMessage(url) { // functions contents here } function loadBothMyFunctions() { setTimeout("closeMessage()", 100) setTimeout("displayMessage('page.php')", 200); } </script> <a href="javascript:void(0)" onclick="loadBothMyFunctions()">Add</a> Quote Link to comment 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.