Ok, we've got the bits, but how do we use them? Adding jQuery Mobile support to a site requires the following three steps at a minimum:
DOCTYPEto the page:
<!DOCTYPE html>. This is used to help inform the browser about the type of content it will be dealing with.
<metaname="viewport"content="width=device-width,initial-scale="1">. This helps set better defaults for pages when viewed on a mobile device.
Let's look at a modified version of our previous HTML file that adds all of the above:
code 1-2: test2.html <!DOCTYPE html> <html> <head> <title>First Mobile Example</title> <meta name="viewport" ...