Javascript Confirmation

CK CK 3788 
Created at  
590 0 0
A javascript confirmation box can be a handy way to give your visitors a choice of whether or not an action is performed. A confirmation box will pop up much like an alert box, but will allow the viewer to press an "OK" or "Cancel" button. Here is the basic command for creating a confirmation box:

var where_to= confirm("Do you really want to go to this page??");

if (where_to== true)
 {
   window.location="http://yourplace.com/yourpage.htm";
 }
else
 {
  window.location="http://www.strcpy.com";
  }

This is also very useful function if you are planning to develop AJAX applications.
Tags Exit Code HTML Javascript Facebook X
Comments 0
Similar posts
  1. Javascript Prompts
    448
  2. How to know browser version in javascript ?
    439
  3. How to know the browser name in Javascript ?
    639
  4. Select All, None, Invert checkbox
    504
  5. Photo thumbnail viewer implemented in javascript
    482
  6. To get web browser capability
    522
  7. Javascript based query parser for AJAX application
    564
  8. Displays the html tags without rendering on a webpage
    350
  9. To hide/show area of web page without re-loading a page
    1,019
  10. To compare two HTML tables on web page in real time
    514
  11. Photoshop script programming in Javascript
    531
  12. How to return exit code such as exit() function in C/C++ ?
    661
  13. Simple RSS Reader based on javascript
    502
  14. How to find the ip address of a client machine from a web application?
    518
  15. Clipboard copy function working
    3,354
  16. IFRAME Auto Resize in IE, FireFox by Javascript
    454
  17. How to include Javascript from anonther ?
    409
  18. Javascript based Browser Sniffing
    430
  19. Javascript based Regular Expression Tester
    373
  20. Two useful string functions - substr & substring
    404
  21. Is there URLEncode function in Javascript ?
    390
  22. Move window
    546
  23. How to calculate page loading time ?
    358
  24. Number Of Vists
    507
  25. Add Message On Mouse Traling
    2,546
  26. Tooltip
    407
  27. Document Fader
    346
  28. Book Mark This Site
    403
  29. Icon Coupled Url
    425
  30. Button That Will Close The Browser Window
    349
  1. Atlassian Jira Ticket API Response Example
    2,748
  2. Three different type of Word-Wrap options in HTML CSS
    1,181
  3. JavaScript code to load XML Document
    601
  4. Creating a Pinterest-Style Card Layout with Bootstrap and Masonry
    590
  5. Equal Height Blocks in Bootstrap with JavaScript
    709
  6. Copy text to clipboard in Javascript
    1,714
  7. To block copy & paste on your blog content
    899
  8. Shake your browser window by Javascript
    933
  9. Photoshop script programming in Javascript
    531
  10. To compare two HTML tables on web page in real time
    514
  11. To hide/show area of web page without re-loading a page
    1,019
  12. Displays the html tags without rendering on a webpage
    350
  13. Javascript based query parser for AJAX application
    564
  14. To get web browser capability
    522
  15. Photo thumbnail viewer implemented in javascript
    482
  16. Javascript Prompts
    448
  17. How to know browser version in javascript ?
    439
  18. How to know the browser name in Javascript ?
    639
  19. Select All, None, Invert checkbox
    504
  20. Simple RSS Reader based on javascript
    502
  21. How to find the ip address of a client machine from a web application?
    518
  22. Put Date Time on HTML
    550
  23. IFRAME Auto Resize in IE, FireFox by Javascript
    454
  24. How to elimiate the "Restore Previous Session" dialog when FireFox 2.0 starts
    408
  25. How to include Javascript from anonther ?
    409
  26. Javascript based Browser Sniffing
    430
  27. Javascript based Regular Expression Tester
    373
  28. Two useful string functions - substr & substring
    404
  29. How to block a connection from the certain site ?
    350
  30. Is there URLEncode function in Javascript ?
    390
Recently updated
  1. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    27
  2. Why SPF and DKIM Are Essential for Linux Email Servers?
    24
  3. How do I create animated background for Google Meet?
    19,731
  4. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    217
  5. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    86
  6. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    153
  7. Array of arguments passed to script in PHP
    85
  8. Invalid Auction Storms in Ad Tech
    93
  9. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    198
  10. The Two Clocks of Ad Server Architecture
    63
  11. Frequency Cap Architecture Overview
    509
  12. Collecting Proof-of-Play from 100,000 Screens
    141
  13. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    280
  14. What is RedisVL?
    105
  15. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    224
  16. TPU & GPU Cluster Management Tools
    234
  17. The Concept of Scaffolding in AI Agents
    222
  18. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    576
  19. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    253
  20. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    328
  21. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    197
  22. Machine Learning: Training vs. Ranking
    213
  23. The Continuous Learning Machine: Designing a Loop That Actually Turns
    217
  24. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    189
  25. Designing a Data Curation System Around a Vector Database
    215
  26. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    229
  27. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    649
  28. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    185
  29. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    207
  30. Understanding Data Lineage
    252