I tried

$('#page18').bind("load",function() {
        alert("total Type") ;

and also i tried doing this

$('#page18').ready( function() {
        alert("total Type")

I want to call a function on Load of a Html5 Jquery Mobile page.

I have various Div with <data-role="page">
Each of them has Id.Now with navigation when I reach on <div id="page18"> i want to cal a function ...

But cant seem to fig it out. can anyone help me with this

Recommended Answers

All 2 Replies


$(document).ready(function() {

JQ has its uses but I think it's overkill for some jobs.

<body onLoad="my_custom_function()">
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.