Menu
Forum
General Car Audio
Subwoofers
Speakers
Amplifiers
Head Units
Car Audio Build Logs
Wiring, Electrical and Installation
Enclosure Design & Construction
Car Audio Classifieds
Home Audio
Off-topic Discussion
The Lounge
What's new
Search forums
Gallery
New media
New comments
Search media
Members
Registered members
Current visitors
Classifieds Member Feedback
SHOP
Shop Head Units
Shop Amplifiers
Shop Speakers
Shop Subwoofers
Shop eBay Car Audio
Log in / Register
Forum
Search
Search titles and first posts only
Search titles only
Search titles and first posts only
Search titles only
Log in / Join
What’s new
Search
Search titles and first posts only
Search titles only
Search titles and first posts only
Search titles only
General Car Audio
Subwoofers
Speakers
Amplifiers
Head Units
Car Audio Build Logs
Wiring, Electrical and Installation
Enclosure Design & Construction
Car Audio Classifieds
Home Audio
Off-topic Discussion
The Lounge
What's new
Search forums
Menu
Reply to thread
Forum
Off-topic Discussion
The Lounge
Java help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="DubbDesigns" data-source="post: 3584515" data-attributes="member: 565130"><p>My friend is trying to create a script not sure what for but he said he want the alert box to pop up when the counter gets to a certain number. Iam not good with java<strong>script*</strong>. Does anyone know how to make it work.</p><p></p><p>[CODE]&lt;html&gt;</p><p>&lt;head&gt;</p><p>&lt;script type="text/javascript"&gt;</p><p>var c=0;</p><p>var t;</p><p></p><p>if (timedCount() &gt; "3") </p><p>{</p><p>alert("&lt;b&gt;Lunch-time!&lt;/b&gt;");</p><p>}</p><p>function timedCount()</p><p>{</p><p>document.getElementById('txt').value=c;</p><p>c=c+1;</p><p>t=setTimeout("timedCount()",1000);</p><p>}</p><p></p><p>function stopCount()</p><p>{</p><p>clearTimeout(t);</p><p>}</p><p>&lt;/script&gt;</p><p>&lt;/head&gt;</p><p></p><p>&lt;body&gt;</p><p>&lt;form&gt;</p><p>&lt;input type="button" value="Start count!" onClick="timedCount()"&gt;</p><p>&lt;input type="text" id="txt"&gt;</p><p>&lt;input type="button" value="Stop count!" onClick="stopCount()"&gt;</p><p>&lt;/form&gt;</p><p></p><p>&lt;p&gt;</p><p>Click on the "Start count!" button above to start the timer. The input </p><p></p><p>field will count forever, starting at 0. Click on the "Stop count!" </p><p></p><p>button to stop the counting.</p><p>&lt;/p&gt;</p><p>&lt;/body&gt;</p><p>&lt;head&gt;</p><p>&lt;script type="text/javascript"&gt;</p><p>function disp_alert()</p><p>if (c==1)</p><p>{</p><p>alert(c-1);</p><p>}</p><p>&lt;/script&gt;</p><p>&lt;/head&gt;</p><p>&lt;body&gt;</p><p></p><p>&lt;input type="button" onclick="disp_alert()" value="Display alert box" /&gt;</p><p></p><p>&lt;/body&gt;</p><p>&lt;/html&gt;[/CODE]</p></blockquote><p></p>
[QUOTE="DubbDesigns, post: 3584515, member: 565130"] My friend is trying to create a script not sure what for but he said he want the alert box to pop up when the counter gets to a certain number. Iam not good with java[B]script*[/B]. Does anyone know how to make it work. [CODE]<html> <head> <script type="text/javascript"> var c=0; var t; if (timedCount() > "3") { alert("<b>Lunch-time!</b>"); } function timedCount() { document.getElementById('txt').value=c; c=c+1; t=setTimeout("timedCount()",1000); } function stopCount() { clearTimeout(t); } </script> </head> <body> <form> <input type="button" value="Start count!" onClick="timedCount()"> <input type="text" id="txt"> <input type="button" value="Stop count!" onClick="stopCount()"> </form> <p> Click on the "Start count!" button above to start the timer. The input field will count forever, starting at 0. Click on the "Stop count!" button to stop the counting. </p> </body> <head> <script type="text/javascript"> function disp_alert() if (c==1) { alert(c-1); } </script> </head> <body> <input type="button" onclick="disp_alert()" value="Display alert box" /> </body> </html>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forum
Off-topic Discussion
The Lounge
Java help
Top
Menu
What's new
Forum list