SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How I can automatically close the alert box as soon as it appears

    Code:
    alert("Hiii");
    Hi friends....
    I have an alert message just like above
    I want to close it automatically as soon as it appears.
    It means I don't want to show this alert message to client.
    Can anyone tell how i can do it???
    Please help me......
    Thanks in advance.....

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,183
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    With the default browser alert box you can't as its a function, you would need to create a custom alert box in order to do this.


    Sent from my iPhone using Tapatalk
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need it ,too .

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    So write your own code to display the message instead of using alert(). You shouldn't be using alert() in live JavaScript code anyway as it is intended as a debugging tool. Some browsers include a checkbox for turning JavaScript off for that web page in every alert displayed. Do you really want your visitors turning off your script part way through processing?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    I suspect that he's wanting to cause the taskbar icon to flash when the window is not active.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    I suspect that he's wanting to cause the taskbar icon to flash when the window is not active.
    Yes paul....
    You are right i use alert for only flash taskbar but i don't want to show it to user.
    Can it automatically close it???

  7. #7
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ankit.pandeyc012 View Post
    Yes paul....
    You are right i use alert for only flash taskbar but i don't want to show it to user.
    Can it automatically close it???
    Nope.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •