august 30, 2013cisweb.bristolcc.edu/~pgrocer/jquerymobile/basics.pdfto the stylesheet and the jquery...

19
basicsSmartboard.notebook 1 August 30, 2013 JQuery Mobile is a JavaScript library and a framework for developing mobile applications that work on a wide variety of devices. <!DOCTYPE html> <html> <head> <title>Testing...</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile1.0a1.min.css" /> <script src="http://code.jquery.com/jquery1.4.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile1.0a1.min.js"></script> </head> <body> <div datarole="page"> <div datarole="header"> <h1>Testing...</h1> </div> <div datarole="content"> <p>This is just some basic writing. This page is being written as I experiment with JQuery Mobile.</p> </div> <div datarole="footer"> <h4>The end...</h4> </div> </div> </body> </html> The information in the head sets up the page to use CDNhosted versions. You link to the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5 including the doctype, the head and the body tags. The div tag has a series of datarole attributes such as page and within page header, content and footer.

Upload: others

Post on 02-Apr-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

1

August 30, 2013

JQuery Mobile is a JavaScript library and a framework for developing mobile applications that work on a wide variety of devices.

<!DOCTYPE html> <html> 

<head> <title>Testing...</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.css" /><script src="http://code.jquery.com/jquery­1.4.3.min.js"></script><script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.js"></script>

</head> <body> 

<div data­role="page">

<div data­role="header"><h1>Testing...</h1>

</div>

<div data­role="content"><p>This is just some basic writing. This page is being

                   written as I experiment with JQuery Mobile.</p></div>

<div data­role="footer"><h4>The end...</h4>

</div></div></body></html>

The information in the head sets up the page to use CDN­hosted versions.  You link to the stylesheet and the JQuery libraries that set up JQuery Mobile for use.

Note that we are using standard HTML5 including the doctype, the head and the body tags. The div tag has a series of data­role attributes such as page and within page header, content and footer.  

Page 2: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

2

August 30, 2013

Page 3: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

3

August 30, 2013

Notice what happens when I eliminate the data­rolein the inner divisions.

Page 4: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

4

August 30, 2013

<!DOCTYPE html><html><head>  <title>Testing JQuery Mobile</title>  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.css" />  <script src="http://code.jquery.com/jquery­1.4.3.min.js"></script>  <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.js"></script></head> <body> <body> <div data­role="page" id="home">

  <div data­role="header">    <h1>Testing...</h1>  </div>

  <div data­role="content">    <p>This is just some basic writing. This page is being       written as I experiment with JQuery Mobile.</p>  </div>

  <div data­role="footer">    <h4>The end (home)...</h4>  </div></div><div data­role="page" id="moreinfo">

  <div data­role="header">    <h1>Testing the second page...</h1>  </div>

  <div data­role="content">    <p>I am putting a second page in the basic code so as you can see above       there is a page with an id of home and there is a page with an id of       moreinfo.  I am showing you an experiment about how this works. Note       that to see this second page, you can type #moreinfo after the address.       Notice that when you do that and view the second page, the back button       appears.</p>  </div>

  <div data­role="footer">    <h4>The end (moreinfo) ...</h4>  </div></div><div data­role="page" id="contact">

  <div data­role="header">    <h1>Testing the third page</h1>  </div>

  <div data­role="content">    <p>This is testing the third page in the basic code. This will       show content so it will give the address of my web site which       is www.pgrocer.net.  Note that the page has an id of contact in       this page. To see this page, you would enter #contact after       the address of the page.</p>  </div>

  <div data­role="footer">    <h4>The end (contact)...</h4>  </div></div></body></html>

JQueryBasic1with3.html

Note that I have set this up to include the information for three different pages.  The thing that identifies the pages is the id.

Page 5: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

5

August 30, 2013

Shows the default first page

Page 6: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

6

August 30, 2013

Note #moreinfoand #content tosee the second andthird pages.

Page 7: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

7

August 30, 2013

<!DOCTYPE html><html><head>  <title>Testing JQuery Mobile</title>

  <meta name="viewport" content="width=device­width, initial­scale=1">   <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.css" />  <script src="http://code.jquery.com/jquery­1.4.3.min.js"></script>  <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.js"></script></head> <body> <body> <div data­role="page" id="home">

  <div data­role="header">    <h1>Testing...</h1>  </div>

  <div data­role="content">    <p>This is just some basic writing. This page is being       written as I experiment with JQuery Mobile.</p>       <ul data­role="listview" data­inset="true">             <li><a href="#moreinfo">More Information</a></li>             <li><a href="#contact">Contact</a></li>      </ul>  </div>

  <div data­role="footer">    <h4>The end (home)...</h4>  </div></div><div data­role="page" id="moreinfo">

  <div data­role="header">    <h1>Testing the second page...</h1>  </div>

  <div data­role="content">    <p>I am putting a second page in the basic code so as you can see above       there is a page with an id of home and there is a page with an id of       moreinfo.  I am showing you an experiment about how this works. Note       that to see this second page, you can type #moreinfo after the address.       Notice that when you do that and view the second page, the back button       appears.</p>  </div>

  <div data­role="footer">    <h4>The end (moreinfo) ...</h4>  </div></div><div data­role="page" id="contact">

  <div data­role="header">    <h1>Testing the third page</h1>  </div>

  <div data­role="content">    <p>This is testing the third page in the basic code. This will       show content so it will give the address of my web site which       is www.pgrocer.net.  Note that the page has an id of contact in       this page. To see this page, you would enter #contact after       the address of the page.</p>  </div>

  <div data­role="footer">    <h4>The end (contact)...</h4>  </div></div></body></html>

This gives me the links to the second and third pages.

<!DOCTYPE html><html><head>  <title>Testing JQuery Mobile</title><!DOCTYPE html><html><head>  <title>Testing JQuery Mobile</title>  <meta name="viewport" content="width=device­width, initial­scale=1">   <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.css" />  <script src="http://code.jquery.com/jquery­1.4.3.min.js"></script>  <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.js"></script></head> 

  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.css" />  <script src="http://code.jquery.com/jquery­1.4.3.min.js"></script>  <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile­1.0a1.min.js"></script></head> 

Insert the meta line for clarity.

Page 8: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

8

August 30, 2013

Now I have links to the other pages frompage one. I clicked on the links to bring upthe second and third pages.

Page 9: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

9

August 30, 2013

Note the useof data­theme to change the look.Experiment with a, b, c, d and e for your data­theme.

Page 10: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

10

August 30, 2013

This uses data­role of button.

Page 11: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

11

August 30, 2013

It is recommended you use rel="external"for external pages.

Page 12: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

12

August 30, 2013

See pages you arelinking to on followup Smartboard pages.

Page 13: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

13

August 30, 2013

Page 14: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

14

August 30, 2013

Note just the division is shown here.

Page 15: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

15

August 30, 2013

Page 16: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

16

August 30, 2013

Page 17: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

17

August 30, 2013

Now I am bringingstyle to the page andlinking to an external image.

Page 18: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

18

August 30, 2013

Page 19: August 30, 2013cisweb.bristolcc.edu/~pgrocer/JQueryMobile/basics.pdfto the stylesheet and the JQuery libraries that set up JQuery Mobile for use. Note that we are using standard HTML5

basicsSmartboard.notebook

19

August 30, 2013

Note the table structure using scope.