Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

Pritom Nandy
More...

Resources » Code Snippets » jQuery

How to show alert message using jQuery


Posted Date:     Category: jQuery    
Author: Member Level: Gold    Points: 15


In this article I have explained about how to use show Hello World Alert box using JQuery. Each steps I have clearly explained in this article .



 



Introduction:
JQuery is not a language but it is a well written Java script code. It was released in Jan 2006 at Barcamp NYC by John Resig. jQuery helps to improve the performance of the application. We can develop most browser compatible web page.No need to learn fresh new syntax to use jQuery, knowing simple JavaScript syntax is enough



In this article I have explained about how to use show Hello World Alert box using JQuery Each steps I have clearly explained in this article .
This application will use Java script alert method to display the Hello World
message. When user clicks on the button Click Me , the alert message is displayed to the user.
The following method is attached to button click event




$("#Button1").click(function()
{
//code here
}



Within <script> tag you need to write jquery script.
When the page loading is finished the following code will executes



$(document).ready(function(){
// Write code here
});

Full code:

<html xmlns="http://www.w3.org/1999/xhtml" >

<head>
<title>Hello World Alert box using JQuery</title>
<script language="javascript" src="jquery-1.2.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#Button1").click(function(){
alert("HELLO WORLD!");
});
});
</script>
</head>
<body>
<form runat="server">
<asp:Button ID="Button1" runat="server" Text="Click me" />

</form>
</body>
</html>


jQuery javascript file can be downloaded from jQuery Official website http://www.jquery.com/

To load JQuery in your application

<script type="text/javascript" src="jquery-1.2.6.js"> </script>





Did you like this resource? Share it with your friends and show your love!


Responses to "How to show alert message using jQuery"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: How to use selectors in JQuery
    Previous Resource: How to show simple popup window using jQuery
    Return to Resources
    Post New Resource
    Category: jQuery


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    How to show alert message using jQuery  .  
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.