sphinx Posted December 7, 2010 Share Posted December 7, 2010 I want it to appear in 3 seconds, here it is: var link_text = "<input type="submit" name="login" value="Login">"; do i need to do something to it? thanks Link to comment https://forums.phpfreaks.com/topic/220951-why-isnt-this-displaying/ Share on other sites More sharing options...
brianlange Posted December 7, 2010 Share Posted December 7, 2010 Use the setTimeout function. window.onload = function () { setTimeout('showSubmit', 3000); } function showSubmit() { document.write('your submit button'); } Link to comment https://forums.phpfreaks.com/topic/220951-why-isnt-this-displaying/#findComment-1144162 Share on other sites More sharing options...
sphinx Posted December 7, 2010 Author Share Posted December 7, 2010 How do i use that ? thanks for reply Link to comment https://forums.phpfreaks.com/topic/220951-why-isnt-this-displaying/#findComment-1144163 Share on other sites More sharing options...
brianlange Posted December 7, 2010 Share Posted December 7, 2010 function showSubmit() { var link_text = '<input type="submit" name="login" value="Login">'; document.write(link_text); } window.onload = function() { var t = setTimeout('showSubmit();', 3000); } here's a working example: http://www.realtown.com/test19.php Link to comment https://forums.phpfreaks.com/topic/220951-why-isnt-this-displaying/#findComment-1144195 Share on other sites More sharing options...
sphinx Posted December 8, 2010 Author Share Posted December 8, 2010 aww, when i put that onto a page with other stuff, when the button appears it clears everything else on the screen.. Also, why does page keep loading when button appearS? thanks Link to comment https://forums.phpfreaks.com/topic/220951-why-isnt-this-displaying/#findComment-1144327 Share on other sites More sharing options...
brianlange Posted December 8, 2010 Share Posted December 8, 2010 Write it to a div instead using innerHTML. I noticed the loading issue with Firefox. It appears to go away using the following code. Example: http://www.realtown.com/test19.php <script> function showSubmit() { var link_text = '<input type="submit" name="login" value="Login">'; document.getElementById('result').innerHTML = link_text; } window.onload = function() { var t = setTimeout('showSubmit();', 3000); } </script> </head> <div id="result"> </div> Link to comment https://forums.phpfreaks.com/topic/220951-why-isnt-this-displaying/#findComment-1144529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.