nightkarnation Posted October 11, 2008 Share Posted October 11, 2008 Please the important code here is just 1 line...the rest is working perfectly, check on the part where content_lv2.onLoad = succes... If it doesnt...It displays error loading data... In my case, when webpage is online, it may happen from time to time...how can i remedy this to loop back and load again. Calling back loadNews() is a good way?? Do u suggest a better idea? loadNews(); function loadNews() { content_lv2.load("login.php"); content_lv2.action = "readNews"; content_lv2.onLoad = function(succes) { if (succes) { for (var g = 0; g<this.cant; g++) { txtNews.text += content_lv2["date"+g]+": "+newline; txtNews.text += content_lv2["news"+g]+newline; txtNews.text += newline; txtNews.text += newline; } } else { txtNews.text = "Error loading data"; loadNews(); } }; content_lv2.sendAndLoad("login.php", content_lv2, "POST"); } Thanx in advance for your reply! Cheers! Link to comment https://forums.phpfreaks.com/topic/127954-best-way-to-tell-flash-to-load-again-php-when-error-loading-data/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.