Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

start jQuery Alert on page load

Tags:

html

jquery

web

I got no exp or any knowledge in jquery but I want to put an alert on page load. I got this code Examples of using jQuery Alerts

<script src="jquery.alerts.js" type="text/javascript"></script>
<link href="jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />

<!-- Example script -->
<script type="text/javascript">
$(document).ready( function() {
$("#basic_button").click( function() {
jAlert('Example of a basic alert box in jquery', 'jquery basic alert box');
});
});
</script>
</head>
<body>
<p>
<input id="basic_button" type="button" value="Show Basic Alert" />
</p>
</body>
</html>

How to set it on page load?

like image 900
user3518212 Avatar asked Sep 02 '25 17:09

user3518212


2 Answers

$(document).ready( function() {
    jAlert('Example of a basic alert box in jquery', 'jquery basic alert box');
});
like image 62
Hrishi Avatar answered Sep 05 '25 05:09

Hrishi


$(document).ready( function() {
    jAlert('Example of a basic alert box in jquery', 'jquery basic alert box');
});

or You can use Window onload

window.onload=function(){
    jAlert('Example of a basic alert box in jquery', 'jquery basic alert box');
};
like image 40
Lasitha Benaragama Avatar answered Sep 05 '25 07:09

Lasitha Benaragama