jQuery Mobile: Link to a page

This entry is part 7 of 73 in the series jQuery Mobile

Say you have a website yahoo.com and you would like your app to only bring your users to yahoo.com.

<!DOCTYPE html>
    <link href='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js'></script>
<div data-role='page'>
    <div data-role='header'><h1>My Mobile App</h1></div>
    <div data-role='content'>
        <p>Bring Me To Yahoo!</p>
        <a href='http://yahoo.com' data-role='button'>Click Me</a>

This is done by modifying the href in the data-role=’button’ line.

<a href='http://yahoo.com' data-role='button'>Click Me</a>

Clicking on the button will bring you to yahoo.com.  You can try the code here.

Series Navigation<< jQuery Mobile: Data-role
jQuery Moble: Page movement >>