Thursday, June 14, 2012

Display link mailto / Href in alert box javascript

Hi,

Below is the code i implemented for displaying link in href alert box ::

<!doctype html>
<html>
 <meta charset="utf-8">
 <title>Basic usage of the jQuery UI dialog</title>

 <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">

 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function() {
  var $dialog = $('<div></div>')
   .html('Welcome, Please click on the Link to display blog <a href='http://ujjwalbsoni.blogspot.com'>Visit blog</a>')
   .dialog({
    autoOpen: false,
    title: 'Basic Dialog'
   });

  $('#opener').click(function() {
   $dialog.dialog('open');
   // prevent the default action, e.g., following a link
   return false;
  });
 });
 </script>
</head>
<body>

<p>This is an example from the Ujjwal's Blog</a>.</p>

<button id="opener">Show Dialog</button>

</body>
</html>

No comments: