Proč nefunguje javascript
13 příspěvků
Archiv diskusního fóra
Fórum je uzavřené a slouží pouze ke čtení. Některé informace mohou být zastaralé.
-
Mám stránku hang.wz.cz/rodičovský adresář/viet ket qua dua vao.html. Proč nefunguje na on click ?
-
1. Nepoužívej pro názvy souborů diakritiku 2. Nepoužívej v adrese mezery 3. To URL neexistuje 4. Kde by měl bát onClick?
-
Funguje na Frontpage ale nefunguje na server. Má byt odozvu na on click - napíše něco. Tak vypadá: <head><title>Working With VBScript: Exercise 2</title> <script language="VBScript"> <!-- Add this to instruct non-IE browsers to skip over VBScript modules. Option Explicit Sub cmdCalculate_OnClick Dim B Dim CRLF Dim Message Dim A Dim TABSPACE Dim TAX_RATE Dim C Dim D Dim E ' Define our constant values. TAX_RATE = 0.06 CRLF = Chr(13) & Chr(10) TABSPACE = Chr(9) ' Perform order calculations. A = Document.frmExercise2.txtX1.Value * Document.frmExercise2.txtX2.Value D = Document.frmExercise2.txtX3.Value E = Document.frmExercise2.txtX4.Value B = A * TAX_RATE C = A + B document.write("Gia tri A") document.write(A) document.write(B) document.write(C) document.write(D) document.write(E) document.write(C) ' Display the results. Message = "Xin xem bang ABC voi cac so lieu sau:" Message = Message & CRLF & CRLF Message = Message & "A:" & TABSPACE & " = " & A & CRLF Message = Message & "B:" & TABSPACE & " = " & B & CRLF Message = Message & "C:" & TABSPACE & " = " & C & CRLF Message = Message & "D:" & TABSPACE & " = " & D & CRLF Message = Message & "E:" & TABSPACE & " = " & E MsgBox Message,,"Your Total" End Sub --> </script></head> <body> <h1><span lang="vi">Điền dữ liệu vào các ô sau đây</span></h1> <p> <span lang="vi">Số liệu ngày, tháng, năm xảy ra sự việc</span></p> <form name="frmExercise2"> <table> <tbody><tr> <td><b>X1:</b></td> <td><input name="txtX1" size="5" type="text"></td> </tr> <tr> <td><b>X2:</b></td> <td><input name="txtX2" size="5" type="text"></td> </tr> <tr> <td><b>X3:</b></td> <td><input name="txtX3" size="5" type="text"></td> </tr> <tr> <td><b>X4:</b></td> <td><input name="txtX4" size="5" type="text"></td> </tr> </tbody></table> <br> <input name="cmdCalculate" value="Ket qua" type="button"> </form> </body> Pomoc mi dál...<a href="mailto:langerjan@centrum.cz?subject=Re: Proč nefunguje javascript">Quinix</a> napsal: > > 1. Nepoužívej pro názvy souborů diakritiku > 2. Nepoužívej v adrese mezery > 3. To URL neexistuje > 4. Kde by měl bát onClick?
-
musí byt povolen serverem, aby ten javascript funguje normálně jako v Frontpage ? <head><title>Working With VBScript: Exercise 2</title> <script language="VBScript"> <!-- Add this to instruct non-IE browsers to skip over VBScript modules. Option Explicit Sub cmdCalculate_OnClick Dim B Dim CRLF Dim Message Dim A Dim TABSPACE Dim TAX_RATE Dim C Dim D Dim E ' Define our constant values. TAX_RATE = 0.06 CRLF = Chr(13) & Chr(10) TABSPACE = Chr(9) ' Perform order calculations. A = Document.frmExercise2.txtX1.Value * Document.frmExercise2.txtX2.Value D = Document.frmExercise2.txtX3.Value E = Document.frmExercise2.txtX4.Value B = A * TAX_RATE C = A + B document.write("Gia tri A") document.write(A) document.write(B) document.write(C) document.write(D) document.write(E) document.write(C) ' Display the results. Message = "Xin xem bang ABC voi cac so lieu sau:" Message = Message & CRLF & CRLF Message = Message & "A:" & TABSPACE & " = " & A & CRLF Message = Message & "B:" & TABSPACE & " = " & B & CRLF Message = Message & "C:" & TABSPACE & " = " & C & CRLF Message = Message & "D:" & TABSPACE & " = " & D & CRLF Message = Message & "E:" & TABSPACE & " = " & E MsgBox Message,,"Your Total" End Sub --> </script></head> <body> <h1><span lang="vi">Điền dữ liệu vào các ô sau đây</span></h1> <p> <span lang="vi">Số liệu ngày, tháng, năm xảy ra sự việc</span></p> <form name="frmExercise2"> <table> <tbody><tr> <td><b>X1:</b></td> <td><input name="txtX1" size="5" type="text"></td> </tr> <tr> <td><b>X2:</b></td> <td><input name="txtX2" size="5" type="text"></td> </tr> <tr> <td><b>X3:</b></td> <td><input name="txtX3" size="5" type="text"></td> </tr> <tr> <td><b>X4:</b></td> <td><input name="txtX4" size="5" type="text"></td> </tr> </tbody></table> <br> <input name="cmdCalculate" value="Ket qua" type="button"> </form> </body>
-
Ehm... to co jsi tu napsal není javascript, ale VBscript.... což bych já osobně nikdy na webu nepoužil.... jinak by to ale na serveru závislé být nemělo...
-
Pomoc mi někdo napsat javasript , který umožňje zadát 4 čísla a po kliknutí miší bude reagovat takto: napíše tyto čísla, udělá zbytek po dělení osmi součtu těchto čtyřech vstupních čísel(operator Mod) ! Děkuji moc krát
-
offtopic, jaky si narodnosti? nic proti, jen me to zajima:)
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-2" /> <title>Modulo 8</title> <style type="text/css"> label { float: left; text-align: right; width: 4em; } .u { text-decoration: underline; } </style> <script type="text/javascript"> <!-- function calculate () { var n1 = document.getElementById ("number1").value - 0; var n2 = document.getElementById ("number2").value - 0; var n3 = document.getElementById ("number3").value - 0; var n4 = document.getElementById ("number4").value - 0; alert ("(" + n1 + " + " + n2 + " + " + n3 + " + " + n4 + ") % 8 = " + ((n1 + n2 + n3 + n4) % 8)); } --> </script> </head> <body> <div> <label for="number1" accesskey="1">Èíslo <span class="u">1</span>:</label> <input type="text" id="number1" /> </div> <div> <label for="number2" accesskey="2">Èíslo <span class="u">2</span>:</label> <input type="text" id="number2" /> </div> <div> <label for="number3" accesskey="3">Èíslo <span class="u">3</span>:</label> <input type="text" id="number3" /> </div> <div> <label for="number4" accesskey="4">Èíslo <span class="u">4</span>:</label> <input type="text" id="number4" /> </div> <div> <input type="button" value="Vypoèítaj" onclick="calculate()" /> </div> </body>
-
Jsem podnikatel, pochazím z Vietnamu
-
Děkuji za ochotu a rychlé reagování.Zkouším to.
-
alert ("(" + n1 + " + " + n2 + " + " + n3 + " + " + n4 + ") % 8 = " + ((n1 + n2 + n3 + n4) % 8)); musí někde ještě " a ) po alert("(..? Zatím ohlasí chyba. Nevím kde je. Zkoušel jsem na Frontpage
-
Jediné, čo je na tom zle, je že zmizli tagy "html" (wz.cz rulez) a premenilo sa Č na È (pspad rulez). Na tom riadku žiadna chyba nie je, ale môžeš napísať aspoň celé chybové hlásenie...
-
Ohlasí chyba: Řadek 15, znak 21, byl očekávan znak { potom řadek 47, znak 1, byl očekávan objekt. Pomoc mi ještě zjistit kde je chyba? Díki