473,320 Members | 2,180 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,320 software developers and data experts.

window.confirm behaviour in if else statements

Hi all,

Judging by the topics in here this should be a snap for all of you!

Can any one explain why when i use the window.confirm in an if else
statement it behaves like this:

if (var == value)
{
do this
}
else
{

addTheTrack = window.confirm('confirm overwrite')
if(addTheTrack == true)
{
do that
};
};
addTheTrack is initialised earlier.
When i execute this code is does the window.confirm action whether if
(var == value) is true or not and if i switch it to if (var = value)
then it does the else...

Mucho confoosed.

Any help appreciated Doo x

Sep 25 '06 #1
1 2486

Doo0592 wrote:
Hi all,

Judging by the topics in here this should be a snap for all of you!

Can any one explain why when i use the window.confirm in an if else
statement it behaves like this:

if (var == value)
"var" is a javascript keyword, you can't assign a value to it (you
should get an error). Therefore it can never have the same value as
some other variable - use some other name.

[...]
>
addTheTrack is initialised earlier.
When i execute this code is does the window.confirm action whether if
(var == value) is true or not and if i switch it to if (var = value)
then it does the else...
As far as I can see, the condition expression results in a syntax error
and that's the end of that.
--
Rob

Sep 25 '06 #2

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

Similar topics

10
by: Scott | last post by:
I'm new to ASP, but I've been programming in VB for several years, and I'm having a few issues with this ASP enhancement I'm working on. I've found ASP to be a lot different than what I'm use to...
2
by: Terry | last post by:
anyone know how to pop up a confirm window with (Y) & (N)?? I want to pop up a "Do you want to continue?" message box (javascript only, can't use vbscript) with (Y) & (N). when click (N), then...
2
by: JPL Verhey | last post by:
(i hope somebody (else) will read and have an idea! Thnx) Hi, With a script in a popup window, I want to check if certain content is present in a page loaded into the frame "main" of the...
18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
15
by: dixie | last post by:
I have a command to open the Access Options dialogue from code: DoCmd.RunCommand acCmdOptions It also opens the Database Window behind it. Is it possible to open the Options without having...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
1
by: chris | last post by:
Hi, In ASP.NET page, when my user tries to edit a record in gridview, I need to display a confirmation message, if another user is editing the same record. Since the confirmation message will...
4
by: Arnab das | last post by:
Below is the javascript code i am using function confirmDelete() { var returnValue = window.confirm("Deleting the current page. Continue?"); return returnValue; // var...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.