Sunday, May 8, 2011

How to add Alert message box to your blogger

How to add Alert message box to your blogger

alert'alert box,message,blogger



This tip is helpful for bloggers,You can display new message box to your site when visitor came your site.Using this, we can give special announcement.Most important is  If visitor click "OK" he can visit the site.If not, we can redirect him to some other site.This gadget will helpful some time.(not mean every time).Thats why i share with you.you can try it.


1.  Log in to your blogger account and Go to Design >> Page Element

2. Click Add Gadget and select 'HTML/Javascript'

3. Paste below one of below code.

<script  type="text/javascript">
    confirm('Are you sure you want to  continue?');
    if  (confirm('Are you sure you want  to continue?')) {
     window.location =  "http://www.bloggertrix.com/";
    }
    else  {
     window.location =  "http://www.google.com/";
    }
    </script>

* Replace with Blue color text as your like.
* Replace Red color URL with,what you want to redirect site if User clicked OK
* Replace Green color URL with, what you want to redirect site If User clicked cancel

4. Save HTML/Javascript. you are done.

5 comments:

  1. if you're using adsense..beware to redirect URL. Coz this avoid TOS Adsense

    ReplyDelete
  2. Hey The Window Keeps on coming even after Cliking OK . What to do ?

    ReplyDelete
  3. guess this coding(alert box) will be (repeating) looping for every refresh , could you just sort it out

    ReplyDelete