11. januar 2012 - 21:58 Der er 2 kommentarer og
1 løsning

Programmering af Html med Java.

Hej jeg har de 2 koder her den ene virker og den anden virker ikke hvordan kan det være?

Problemet med at den ikke virker er at javaén starter på nr 2 men ikke på nr 1.
Det som jeg tror er problemet er et lille fejl tegn eller et lille forkert ord kan bare ikke finde det når jeg sammenligner de 2 scripts.



Nr 1. Den kode som ikke virker
<html> <head> <meta name="GENERATOR" content="Evrsoft First Page"> <title></title> </head> <body> <center> Great Gina Sisters </center> <table> <tbody> <tr> <td><img src="/Commodore64/Pictures/great-giana-sisters.jpg" width="570" height="285"></td> <td></td> <td></td> </tr> </tbody> </table> <table> <tbody> <tr> <td> <applet id="c64" name="c64" code="C64Applet.class" archive="Commodore64/c64small.jar" WIDTH="386" HEIGHT ="288" MAYSCRIPT> <param name="soundOn" value="1"> <param name="doubleScreen" value="0"> <!-- <param name="autostartDisk" value="games/delta.t64"> --> <param name="autostartPGM" value=random> <!--"DELTA.BIN"> --> <param name="extendedKeyboard" value="1"> <param name="hotkey-f1" value='enterText("load \"$\",8~run~")'> <!-- <param name="autostartProgram" value="1"> --> <param name="autostartProgram" value="0"> </applet> <br></td> <td><a onmouseover="setOverImg('1','');" onmouseout="setOutImg('1','');" href="java script:document.c64.reset()" target="Reset"><img id="button1" border="0" hspace="5" vspace="5" src="buttons/button1up.png" name="button1"></a><br> <a onmouseover="setOverImg('2','');" onmouseout="setOutImg('2','');" href="java script:document.c64.setStick(0)" target="Joystick 0"><img id="button2" border="0" hspace="5" vspace="5" src="buttons/button2up.png" name="button2"></a><br> <a onmouseover="setOverImg('3','');" onmouseout="setOutImg('3','');" href="java script:document.c64.setStick(1)" target="Joystick 1"><img id="button3" border="0" hspace="5" vspace="5" src="buttons/button3up.png" name="button3"></a><br> <a onmouseover="setOverImg('4','');" onmouseout="setOutImg('4','');" href="java script:document.c64.setSoundOn(false)" target="Sound off"><img id="button4" border="0" hspace="5" vspace="5" src="buttons/button4up.png" name="button4"></a><br> <a onmouseover="setOverImg('5','');" onmouseout="setOutImg('5','');" href="java script:document.c64.setSoundOn(true)" target="Sound on"><img id="button5" border="0" hspace="5" vspace="5" src="buttons/button5up.png" name="button5"></a><br> <a onmouseover="setOverImg('6','');" onmouseout="setOutImg('6','');" href="java script:document.c64.pause()" target="Pause"><img id="button6" border="0" hspace="5" vspace="5" src="buttons/button6up.png" name="button6"></a><br> <a onmouseover="setOverImg('7','');" onmouseout="setOutImg('7','');" href="java script:document.c64.unpause()" target="unPause"><img id="button7" border="0" hspace="5" vspace="5" src="buttons/button7up.png" name="button7"></a><br> <a onmouseover="setOverImg('8','');" onmouseout="setOutImg('8','');" href="java script:document.c64.fullscreen(true)" target="Fullscreen"><img id="button8" border="0" hspace="5" vspace="5" src="buttons/button8up.png" name="button8"></a><br></td> <td></td> </tr> </tbody> </table> <table> <tbody> <tr> <td> <p>Joystick emulation:</p> <ul> <li>Up: Numpad 8 or arrow up</li> <li>Down: Numpad 5,2 or arrow down</li> <li>Left: Numpad 4 or arrow left</li> <li>Right: Numpad 6 or arrow right</li> <li>Fire: Numpad 0 or shift</li> </ul>Other important keys <ul> <li>ctrl-alt-backspace: resets the emulator</li> <li>ctrl-f12: toggle fullscreen mode</li> <li>ESC: run-stop</li> </ul> </td> <td></td> <td></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td></td> </tr> </tbody> </table> </body> </html>



Nr 2. Den kode som virker

<html> <head> </head> <body > <h3></h3> <center id=center><applet id="c64" name="c64" code="C64Applet.class" archive="/Commodore64/c64small.jar" WIDTH="768" HEIGHT ="568" MAYSCRIPT> <param name="soundOn" value="1"> <param name="doubleScreen" value="1"> <!-- <param name="autostartDisk" value="games/delta.t64"> --> <param name="autostartPGM" value=random> <!--"DELTA.BIN"> --> <param name="extendedKeyboard" value="1"> <param name="hotkey-f1" value='enterText("load \"$\",8~run~")'> <!-- <param name="autostartProgram" value="1"> --> </applet></center><br> <param name="autostartProgram" value="0"> <a href="java script:document.c64.reset()">Reset</a>, <a href="java script:document.c64.setStick(0)">Joystick 0</a>, <a href="java script:document.c64.setStick(1)">Joystick 1</a>, <a href="java script:document.c64.setSoundOn(false)">Sound off</a>, <a href="java script:document.c64.setSoundOn(true)">Sound on</a><br> <a href="java script:document.c64.pause()">Pause</a>, <a href="java script:document.c64.unpause()">unPause</a>, <a href="java script:document.c64.poke(53280,1)">poke 53280,1</a>, <a href="java script:document.c64.fullscreen(true)">Fullscreen</a><br> <a href="java script:document.c64.loadGame(0)">Load Gorf</a>, <p> <a href="java script:document.c64.loadGame(0)">Load Gorf</a>, <a href="java script:document.c64.loadGame(1)">Load Blue Max</a>, <a href="java script:document.c64.loadPGM('c64programs/Bonzieed.prg')">Load Demo</a>, <a href="java script:document.c64.loadPGM('c64programs/jeroen_tel_music.prg')">Load Music</a> <a href="java script:document.c64.insertDisk('c64programs/games1.d64')">Insert disk1</a> <a href="java script:document.c64.enterText('load "$",8~list~')">Load dir...</a> <h4>JaC64 Features and Known Bugs</h4> <b>Feature:</b> <ul> <li>CPU 6510, most of the 6510/02 instructions (inluding many undocumented) <li>RAM/ROM and Bank Switching (ROM - on / off, IO on / off) <li>Interrupts (IRQ, NMI) from raster, sprites, CIA timers, etc. <li>VIC Graphics (text modes, hi-res, multicolor) - instruction/cycle based, sprites (normal, expanded, multicolor, collisions) <li>SID (6581) Sound, with support for most of the SID features such as 3-oscillators/4 waveforms + mix, ADSR, synch., ring-mod, filters, etc. <li>CIA - timers <li>Keyboard & Joystick <li>Support for .d64 .prg/p00 and .t64 files (directly into memory) <li>Support for 1541 - e.g. loading .d64 files from an emulated diskdrive <li>New fullscreen mode activated/deactivated by pressing control-f12 </ul> <b>Known Bugs:</b> <ul> <li> VIC-II emulation is not yet 100% correct (see the demos/music here) <li> Some instruction are also not 100% correct (and/or interrupts handling) <li> SID is not 100% cycle correct </ul> <h4>Requirements to run the applet</h4> A JRE (1.4 or better) is required, and you need to have a folder called "roms" with the rom files for the C64 for the applet to work. From version 1.0 Beta 3 this folder is no longer needed since the rom files are included in the jar file. <h4>Controlling the C64</h4> Joystick emulation: <ul> <li>Up: Numpad 8 or arrow up <li>Down: Numpad 5,2 or arrow down <li>Left: Numpad 4 or arrow left <li>Right: Numpad 6 or arrow right <li>Fire: Numpad 0 or shift </ul> Other important keys <ul> <li>ctrl-alt-backspace: resets the emulator <li>ctrl-f12: toggle fullscreen mode <li>ESC: run-stop </ul> <h4>Parameters to the applet</h4> <table> <tr><th>Parameter</th><th>Usage</th></tr> <tr><td>autostartDisk = URL/File</td><td>The disk/tape image to load file from</td></tr> <tr><td>autostartPGM = Filename</td><td>The file from the disk/tape image</td></tr> <tr><td>autostartProgram = file number</td><td>The file number (id) of the program in the games.txt file</td></tr> <tr><td>soundOn = 0/1</td><td>The status of sound (0 mutes applet)</td></tr> <tr><td>doubleScreen = 0/1</td><td>if set to 1 the emulator will be running in double size mode</td></tr> </table> <h4>Thanks to</h4> [2002] Jan Blok - reimplementation of memory model and fixing CPU bugs<br> [2006] JÃ&#65533;�Ã&#65533;¶rg Jahnke - help with refactoring of CPU class<br> [2006] ByteMaster of Cache64.com - extensive testing and bug reporting huge thanks!<br> </body> </html>
Avatar billede arne_v Ekspert
12. januar 2012 - 03:13 #1
Java != JavaScript
Avatar billede kiksen1987 Novice
13. januar 2012 - 16:10 #2
Java != JavaScript
true == that
Avatar billede kiksen1987 Novice
13. januar 2012 - 16:11 #3
btw - få fat i firebug til firefox og debug koden derigennem
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester