473,785 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

whats wrong here?

can anybody tell me what is wrong here, I got this shockwave test from
javascript in easy steps but it doesnt open the pages required

<html>
<head>
<script type = "text/javascript">
if ( (navigator.appN ame == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
|| navigator.plugi ns && navigator.plugi ns [ "Shockwave Flash" ] )
|| navigator.plugi ns [ "Shockwave Flash 2.0" ] )
window.location = "index01.ht ml" ;
else
window.location = "index.html " ;
</script>
</head>
<body>
</body>
</html>

the index01 has a flash content, the index doesnt

TIA
Jul 20 '05 #1
9 1863
iz0nlee wrote on 12 jul 2003 in comp.lang.javas cript:
can anybody tell me what is wrong here, I got this shockwave test from
javascript in easy steps but it doesnt open the pages required

<html>
<head>
<script type = "text/javascript">
if ( (navigator.appN ame == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
|| navigator.plugi ns && navigator.plugi ns [ "Shockwave Flash" ] )
|| navigator.plugi ns [ "Shockwave Flash 2.0" ] )
4 '(' and 5 ')'
window.location = "index01.ht ml" ;
[I think no ';' here]
else
window.location = "index.html " ;
</script>
</head>
<body>
</body>
</html>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
thanks for the prompt reply,
I am not quite sure what this means

4 '(' and 5 ')'

I tried removing the semicolon from the first url but it didnt work.

I am running winXP and IE6, if that makes a difference.
when I click the 'index02.htm' file it just brings that blamk page up
instead of redirecting to index01.htm as it should.
thanks again though
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
iz0nlee wrote on 12 jul 2003 in comp.lang.javas cript:
can anybody tell me what is wrong here, I got this shockwave test from
javascript in easy steps but it doesnt open the pages required

<html>
<head>
<script type = "text/javascript">
if ( (navigator.appN ame == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
|| navigator.plugi ns && navigator.plugi ns [ "Shockwave Flash" ] )
|| navigator.plugi ns [ "Shockwave Flash 2.0" ] )


4 '(' and 5 ')'
window.location = "index01.ht ml" ;


[I think no ';' here]
else
window.location = "index.html " ;
</script>
</head>
<body>
</body>
</html>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 20 '05 #3
In article <Xn************ ********@194.10 9.133.29>, Evertjan.
<ex************ **@interxnl.net > writes
iz0nlee wrote on 12 jul 2003 in comp.lang.javas cript:

<snip>
window.location = "index01.ht ml" ;


[I think no ';' here]

<snip>

The semicolon is perfectly respectable here. Remember that complicated
statements are built from simpler statements, and that some kinds of
statement can (must in C, C++, Java) end in a semicolon.

If a semicolon looks strange think of it as being inside its statement,
not as separate punctuation outside.

John
--
John Harris
mailto:jo**@jgh arris.demon.co. uk
Jul 20 '05 #4
John G Harris wrote on 12 jul 2003 in comp.lang.javas cript:
In article <Xn************ ********@194.10 9.133.29>, Evertjan.
<ex************ **@interxnl.net > writes
iz0nlee wrote on 12 jul 2003 in comp.lang.javas cript:

<snip>
window.location = "index01.ht ml" ;


[I think no ';' here]

<snip>

The semicolon is perfectly respectable here. Remember that complicated
statements are built from simpler statements, and that some kinds of
statement can (must in C, C++, Java) end in a semicolon.

If a semicolon looks strange think of it as being inside its statement,
not as separate punctuation outside.


You are right, of cource, John.

if(condition)
statementtrue;
else
statementfalse;
statementalways ;

The problem in my mind was, that without {} only one statement is
allowed.

I think it was Pascal syntax that disallowed a ; in that position
otherwise the "else" was orphaned ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #5
Thanks to all of you who have commented, I found the errant '(' and script
is now as below and I've checked it till I'm blue in the face but it still
only returns its own page and doesnt jump to the 'index01'page as it should
(I think)

<html>
<head>
<script type = "text/javascript">
if ( (navigator.appN ame == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
||
(navigator.plug ins
&& navigator.plugi ns[ "Shockwave Flash" ] )
||
navigator.plugi ns [ "Shockwave Flash 2.0" ] )
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>
</head>
<body>
failed again
</body>
</html>

I'm sure there must be a simple explanation, perhaps its something to do
with the 'pipe' characters, I'm not sure what they do, but for the time
being I might just put the flash pages up for now as most people use
shockwave capable browsers anyway and my site doesnt get hits in the
millions exactly so it probably wont matter.
Thanks for all your suggestions and interest
regards
Jul 20 '05 #6
iz0nlee wrote on 13 jul 2003 in comp.lang.javas cript:
Thanks to all of you who have commented, I found the errant '(' and
script is now as below and I've checked it till I'm blue in the face
but it still only returns its own page and doesnt jump to the
'index01'page as it should (I think)

<html>
<head>
<script type = "text/javascript">
if ( (navigator.appN ame == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
||
(navigator.plug ins
&& navigator.plugi ns[ "Shockwave Flash" ] )
||
navigator.plugi ns [ "Shockwave Flash 2.0" ] )
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>
</head>
<body>
failed again
</body>
</html>


Now start testing by deviding the problem, make three seperate testfiles
and execute them in the same directory as your present html-file:

============ test1.html =============== =====

<script type = "text/javascript">
if ( true )
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>

============ test2.html =============== =====

<script type = "text/javascript">
if ( false )
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>

============ test3.html =============== =====

<script type = "text/javascript">
result =(navigator.app Name == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
||
(navigator.plug ins
&& navigator.plugi ns[ "Shockwave Flash" ] )
||
navigator.plugi ns [ "Shockwave Flash 2.0" ] )

alert(result) // must be true or false
</script>

=============== =============== =============== ==

And let us hear the results.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #7
I did just what you said and found when I put the Netscape part in it
failed.
I re wrote it like this and it works though I dont have netscape to test it,
(nor Mac or win3.1 for that matter)
I'm happy it works now though and thanks for all your help.
I'll put the script in the head of index.htm then it should transfer most
people to index01

regards
p.s. I answered this a few minutes ago but sent it 'reply' instead of
'reply group' by accident. Sorry

<html>
<head>
<script type = "text/javascript">
if ( navigator.appNa me == "Microsoft Internet Explorer"
&& navigator.appVe rsion.indexOf(" Mac") == -1
&& navigator.appVe rsion.indexOf(" 3.1") == -1
|| navigator.plugi ns ["Shockwave Flash"]
|| navigator.plugi ns ["Shockwave Flash 2.0"]
)
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>
</head>
<body>
failed again
</body>
</html>
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
iz0nlee wrote on 13 jul 2003 in comp.lang.javas cript:
Thanks to all of you who have commented, I found the errant '(' and
script is now as below and I've checked it till I'm blue in the face
but it still only returns its own page and doesnt jump to the
'index01'page as it should (I think)

<html>
<head>
<script type = "text/javascript">
if ( (navigator.appN ame == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
||
(navigator.plug ins
&& navigator.plugi ns[ "Shockwave Flash" ] )
||
navigator.plugi ns [ "Shockwave Flash 2.0" ] )
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>
</head>
<body>
failed again
</body>
</html>


Now start testing by deviding the problem, make three seperate testfiles
and execute them in the same directory as your present html-file:

============ test1.html =============== =====

<script type = "text/javascript">
if ( true )
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>

============ test2.html =============== =====

<script type = "text/javascript">
if ( false )
window.location = "index01.ht m";
else
window.location = "index.htm" ;
</script>

============ test3.html =============== =====

<script type = "text/javascript">
result =(navigator.app Name == "Microsoft Internet Explorer"
&& navigator.appVe rsion.IndexOf ( "Mac" ) == -1
&& navigator.appVe rsion.IndexOf ( "3.1" ) == -1)
||
(navigator.plug ins
&& navigator.plugi ns[ "Shockwave Flash" ] )
||
navigator.plugi ns [ "Shockwave Flash 2.0" ] )

alert(result) // must be true or false
</script>

=============== =============== =============== ==

And let us hear the results.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 20 '05 #8
iz0nlee wrote on 13 jul 2003 in comp.lang.javas cript:
I'll put the script in the head of index.htm then it
should transfer most people to index01
[........]
else
window.location = "index.htm" ;


The others will keep reloading index.htm again and again ??????????
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #9
iz0nlee wrote on 13 jul 2003 in comp.lang.javas cript:
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
iz0nlee wrote on 13 jul 2003 in comp.lang.javas cript:
> I'll put the script in the head of index.htm then it
> should transfer most people to index01
> [........]
> else
> window.location = "index.htm" ;


The others will keep reloading index.htm again and again ??????????

oops, didnt think of that, i will put it in a separate file , index, and
call the pages index01 and index02.
thanks for a timely rescue
regards


Or just delete thes two scriptlines:

else
window.location = "index.htm" ;

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #10

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

Similar topics

3
2395
by: Chris Geerdink | last post by:
combo with PHP. what is wrong with the Javascript? else { include("mysql.php"); $query1 = mysql_query("INSERT INTO gbook (naam, email, text) VALUES ('".$_POST."', '".$_POST."', '".$_POST."')"); ?> <script language="JavaScript"> <!--
1
2751
by: Matthew Wilson | last post by:
I need to write a function crc(msg, len) that gets a char array of length len and then calculates the crc32 for the code. I don't understand what's going wrong in the code I have. It goes bit-by-bit, XORing the most significant bit of the FCS with the msb of the character. All comments are welcome. Yes, this is for a school assignment. If I wanted to just grab some googled code I would; I want to actually understand what I am doing...
5
2835
by: kernel.lover | last post by:
hello, I want to know if a fuction say malloc is declared as void *malloc() then whats the significance of void here. Does void * is used when function has the flexibility to return any type of value by casting that functions with appropriate data type?
3
2043
by: mahsa | last post by:
Hi do you know whats wrong with this code? <asp:HyperLink id="HLink_Help" runat="server" NavigateUrl='<%# "javascript:window.open('comments.aspx?id=1,width=500,height=600, scrollBars=yes');" %>'>Need Help?</asp:HyperLink> -- mahsa
4
3545
by: blah | last post by:
Hello everyone, Ive been trying to get my application to "click" on a button in another application using SendMessage, Ive gotten this far but Im not sure whats wrong with this code, here is the whole application (its small for testing purposes) and it seems that window wraps the text, at least when I preview this post: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing;
7
2231
by: Mike Barnard | last post by:
It's a simple test... VERY SIMPLE. But... In an external stlyesheet some attributes don't show. With the same styles cut and pasted to the test internally it works as expected. Anyone tell me why? Its probably sooooooo obvious, but it is 1.19 am! Thanks. www.thunderin.co.uk/
1
7554
by: Abubakar | last post by:
Hi, In my application, Some of my thread gets stuck somewhere. The vs2k5 debugging "Thread" window shows that stuck thread and I can I dentify it. In its Name column the following text is written: "std::_Container_base::_Orphan_all". What does this mean? Now some general info about whats happnening here: :this is a call to a SendMessage api, which I'm sending to my GUI window, and this call never makes it back. I have checked the GUI...
4
3084
by: LoneHunter01 | last post by:
Basically, I just need a general direction on where to go for this. Yes, this is for a school project, though it's strictly an optional one (and I have tried many solutions, one in-depth). We've only covered a few types of data struct (vectors, heaps, stacks, queues, deques, lists, linked lists, priority queues, trees, etc.). I need to be able to read in a file and keep track of the number of times a word appears and then print out based...
5
2321
by: islayer | last post by:
can someone tell me what is wrong with the bold code? i am just learning perl. the program should create a perl file with a random name (5 letters, followed by a number), but the name is always just the number. whats wrong with my code? #!/usr/bin/perl use Fcntl; @array = (a..z); srand; foreach (1..5) { $name = int(rand scalar(@array));
0
10357
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.