473,395 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

select case

Hoi

Is there a way to use a select case in a javascript?

I already tried it with switch
intHulp = 1;
switch (intHulp)
{
case 1: setTimeout("document.getElementById('myIframe').sr c
='test.htm'",0);
case 2: setTimeout("document.getElementById('myIframe').sr c
='test2.htm'",0);
}
But the result is always that test2.html is placed in my iframe

greeting
Koen
Jul 23 '05 #1
4 5237
Keon wrote:
Is there a way to use a select case in a javascript?

I already tried it with switch
intHulp = 1;
switch (intHulp)
{
case 1: setTimeout("document.getElementById('myIframe').sr c
='test.htm'",0);
break; // ;-)
case 2: setTimeout("document.getElementById('myIframe').sr c
='test2.htm'",0);
}
But the result is always that test2.html is placed in my iframe


Jul 23 '05 #2

"Yann-Erwan Perio" <y-*******@em-lyon.com> wrote in message
news:41***********************@news.free.fr...
Keon wrote:
Is there a way to use a select case in a javascript?

I already tried it with switch
intHulp = 1;
switch (intHulp)
{
case 1: setTimeout("document.getElementById('myIframe').sr c
='test.htm'",0);


break; // ;-)
case 2: setTimeout("document.getElementById('myIframe').sr c
='test2.htm'",0);
}
But the result is always that test2.html is placed in my iframe

indeed stupid of me

thanks
Jul 23 '05 #3
aren't you forgetting break; ?

Phil

"Keon" <ja*********@telenet.be> wrote in message
news:Gt*********************@phobos.telenet-ops.be...
Hoi

Is there a way to use a select case in a javascript?

I already tried it with switch
intHulp = 1;
switch (intHulp)
{
case 1: setTimeout("document.getElementById('myIframe').sr c
='test.htm'",0);
case 2: setTimeout("document.getElementById('myIframe').sr c
='test2.htm'",0);
}
But the result is always that test2.html is placed in my iframe

greeting
Koen

Jul 23 '05 #4
> Is there a way to use a select case in a javascript?

I already tried it with switch
intHulp = 1;
switch (intHulp)
{
case 1: setTimeout("document.getElementById('myIframe').sr c
='test.htm'",0);
case 2: setTimeout("document.getElementById('myIframe').sr c
='test2.htm'",0);
}
But the result is always that test2.html is placed in my iframe


VB's "Select Case" doesn't need the "break;" statement - but javascript's
switch statement does need the break statement in each "case" block -
otherwise they all get executed from the "true" part on down through the
rest of the curly-braced section.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.799 / Virus Database: 543 - Release Date: 11/19/2004
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers...
17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
9
by: Kevin | last post by:
Hi, I am getting a syntax error Microsoft VBScript compilation error '800a03ea' Syntax error On the code below. The error references the "End Select" line Can anyone help me with what I am...
8
by: Penny | last post by:
Hi all, My browser throws this Select Case block back at me pointing out a syntax error on the line: 'Case < 251', between the word 'Case' and the '<' symbol. *************************** ...
10
by: MLH | last post by:
Suppose the following... Dim A as Date A=#7/24/2005# I wish to compare value of A against 2 other values: 1) 8/1/2005 2) 9/1/2005 Which is better and why... First:
7
by: Lauren Quantrell | last post by:
Is there any speed/resource advantage/disadvantage in using Select Case x Case 1 Case 2 etc. many more cases... End Select VS.
3
by: Rob Meade | last post by:
Ok - I *think* this is only different in .net 2.0 - as I've not had any problems in the past, but then maybe I've not tried it... I have a value being read from an xml file where the value maybe...
8
by: | last post by:
Hello, This is gonna sound real daft, but how do I test a Select Case statement for variants of a theme? Here's a snippet of my code... Select Case sUsr Case "Guest", "TsInternetUser",...
1
by: microsoft.public.dotnet.languages.vb | last post by:
Hi All, I wanted to know whether this is possible to use multiple variables to use in the select case statement such as follows: select case dWarrExpDateMonth, dRetailDateMonth case...
4
tjc0ol
by: tjc0ol | last post by:
Hi guys, I'm a newbie in php and I got error in my index.php which is: 1054 - Unknown column 'p.products_id' in 'on clause' select p.products_image, pd.products_name, p.products_id,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.