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 Quote 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'); } Quote 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 Quote 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 Quote 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 Quote 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> Quote Link to comment https://forums.phpfreaks.com/topic/220951-why-isnt-this-displaying/#findComment-1144529 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.