user5650798
user5650798

Reputation:

$(document).ready(function()) is not working in jsp

$(document).ready(function()) is not working in my jsp.I have tried in many forms.

My code is:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="scripts/jquery.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Upload Success</title>
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquerymin.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

<script language="javascript" type="text/javascript"> 
$(document).ready(function() {
alert("Hiiii"); 
});  
</script>
</head>
<body>

 </body>
</html>

Upvotes: 0

Views: 6084

Answers (2)

user5914528
user5914528

Reputation:

$(Document).ready is works when loaded JQuery library. For example:

<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquery.min.js"></script>
<script language="javascript" type="text/javascript"> 

$(document).ready(function() {
    alert("Hello World!!!");  
});  
</script>

Upvotes: 1

user5585864
user5585864

Reputation:

Try This... I have Tested, working fine....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Upload Success</title>
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquery.min.js"></script>
<script language="javascript" type="text/javascript"> 
$(document).ready(function() {
alert("Hiiiiii.........");  
});  
</script>
</head>
<body>

</body>
</html>

Upvotes: 1

Related Questions