O'Reilly logo

WordPress Mobile Applications with PhoneGap by Yuxian Eugene Liang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using jQuery in PhoneGap

Using jQuery in PhoneGap applications is extremely easy; copy and paste the highlighted line as shown in the following code:

<!DOCTYPE HTML>
<html>
<head>
<title>Hello World</title>
<script type="text/javascript" charset="utf-8"src="cordova-1.9.0.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>

That's it! You have just installed jQuery. Seems easy enough, doesn't it? While it may seem so, there are some caveats:

  1. We are assuming that the application has mobile access, and hence access to the hosted jQuery file. If there's no mobile ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required