PHP gevorderde |
|
switch (ex)
{
case 1: { document.write('<font>Caught 1</font><br>'); break }
case 2: { document.write('<font>Caught 2</font><br>'); break }
// And so on.. and so on..
// whatever is passed to switch that is not caught
// by the above fall under this category.
default: { document.write('<font>Error: ' + ex + '</font><br>'); break }
}
switch (ex) { case 1: { document.write('<font>Caught 1</font><br>'); break } case 2: { document.write('<font>Caught 2</font><br>'); break } // And so on.. and so on.. // whatever is passed to switch that is not caught // by the above fall under this category. default: { document.write('<font>Error: ' + ex + '</font><br>'); break } }
Kijk eens aan.
Edit
Ik zou voor zoiets gewoon de if, elseif, else gebruiken. dan heb je veel meer vrijheid |