![]() |
|
[Javascript] Link other script in script. | &[b]#34[/b];hide&[b]#34[/b]; script from running - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [Javascript] Link other script in script. | &[b]#34[/b];hide&[b]#34[/b]; script from running (/showthread.php?tid=3586634) |
Link other script in script. | &[b]#34[/b];hide&[b]#34[/b]; script from running - Johnny Cache - Jun 29, 2013 Hey! I have my little project. i want a window to last 6 seconds, then it should run another script and close itself. I am pretty new to JavaScript but i am willing to learn. Here“s my code: Code function timedOutStart(){Code <script id="runfile" type="text/VBScript">This is the HTML code i am using to execute the script: Code <body [b]onload=[/b]"timedOutStart()">In addition to the first thing i want to realize, i want to stop the VBScript from running onload. It just executes the Batch file at start, but i want it to start the Batch file after those 6 seconds of the first script. I hope you can help me. -L- * - iBones - Jun 30, 2013 I don't quite get what you're doing... You're calling timedOutStart() after six seconds, which calls timedOutStart() after six seconds, which calls timedOutStart() after six seconds... it will never run. You want the VBScript to run after six seconds, then close the window? PHP Code In JavaScript, your getElementById method would not work to run the script. Is VBScript different? If not, it still won't work. You need to put your VBScript in a function and call it. Lastly, never use HTML's onload/onclick/etc. Mixing your JS into your HTML is bad practice. |