![]() |
JAVA: Über javascript nach"index.html" wechseln
Ich hab in meiner html ein javascript mit dem ich eine midi starte/stoppe.
wenn der user auf stop drückt wird die midi angehalten und der browser soll die seite "index.html" wechseln. Ich weiss leider dem befehl nicht :stupid: Danke im voraus! |
Re: JAVA: Über javascript nach"index.html" wechsel
so müsste es gehen:
window.location="index.html"; |
Re: JAVA: Über javascript nach"index.html" wechsel
Nicht ganz aber schon mal n' anfang
Hier mal die seite:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <head> <meta name=vs_defaultClientScript content="JavaScript"> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_controlSound(x, _sndObj, sndFile) { //v3.0 var i, method = "", sndObj = eval(_sndObj); if (sndObj != null) { if (navigator.appName == 'Netscape') method = x; else { if (window.MM_WMP == null) { window.MM_WMP = false; for(i in sndObj) if (i == "ActiveMovie") { window.MM_WMP = true; break; } } if (window.MM_WMP) method = x; else if (sndObj.FileName) method = "run"; } } if (method) eval(_sndObj+"."+method+"()"); else window.location = sndFile; if (method= "stop")(window.location="index.html")); } //--> </script> </head> <body onLoad="MM_controlSound('play','document.midi','badboys.mid')" MS_POSITIONING="GridLayout"> <EMBED NAME='midi' SRC='badboys.mid' LOOP=false AUTOSTART=false MASTERSOUND HIDDEN=true WIDTH=0 HEIGHT=0></EMBED> <div align=center> <input id=Button1 onclick="MM_controlSound('stop','document.midi','badboys.mid')" type=button value="Klick hier um BadBoys zu stoppen" ? name="niko"></div></BODY></html> |
Re: JAVA: Über javascript nach"index.html" wechsel
Bei
Code:
Wenn ich es so:
if (method= "stop)// soll das fenster gewechselt weden;
Code:
mache wechselt er sofort die seite
if (method= "stop")(window.location="index.html"));
|
Re: JAVA: Über javascript nach"index.html" wechsel
= ist bei Javascript eine Zuweisung. Der Vergleichsoperator heißt ==.
|
Re: JAVA: Über javascript nach"index.html" wechsel
Delphier eben :roll:
DANKE |
Re: JAVA: Über javascript nach"index.html" wechsel
Noch ne kleine frage:
wenn die midi komplett apgespielt ist , wäre es nicht schlecht wenn er auch zur index.html zurück geht. Wäre das zu verwirklichen? |
Re: JAVA: Über javascript nach"index.html" wechsel
du kannst das auch viel einfacher machen:
Code:
<html>
<head> <script language="JavaScript"> function loadpage() {window.location="index.html"} </script> </head> <body> <embed src="badboys.mid" loop="true" autostart="true" mastersound hidden="true" width="0" height="0"></embed> <div align=center> <input onclick="loadpage()" type="button" value="Klick hier um BadBoys zu stoppen"> </body> </html> |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:18 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz