Getting started with jquery Mobile-sample code for external link Switching

Source: Internet
Author: User

1. The internal link is in the form of setting the href attribute value to # + id in the <a> label, while the external link adds the rel attribute in <a>, set the property value to external, for example, <a href = "about.html" rel = "external"> 3i Studio </a>
2. Sample Code for external link Switching:
Copy codeThe Code is as follows:
<! Doctype html>
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<Meta name = "viewport" content = "width = device-width, initial-scale = 1"/>
<Link href = "Css/jquery.mobile-1.2.0.min.css" rel = "Stylesheet" type = "text/css"/>
<Script src = "Js/jquery-1.8.3.min.js" type "text/javascript"> </script>
<Script src = "Js/jquery. mobile-1.2.0.min.js" type = "text/javascript"> </script>
</HEAD>
<BODY>
<Section id = "page1" data-role = "page">
<Header data-role = "header"> <Div data-role = "content" class = "content">
<P> <a href = "# w1"> today </a> </p> |
<P> <a href = "#"> tomorrow </a> </p>
</Div>
<Footer data-role = "footer"> </Section>
<Section id = "w1" data-role = "page" data-add-back-btn = "true">
<Header data-role = "header"> <Div data-role = "content" class = "content">
<P> 4 ~ 7'c <br/> Sunny to cloudy <br/> breeze </p>
<Em style = "float: right; padding: 5px">
<A href = "about.html" rel = "external"> 3i Studio </a> provides
</Em>
</Div>
<Footer data-role = "footer"> </Section>
</BODY>
</HTML>

External file about.html code:
Copy codeThe Code is as follows:
<! Doctype html>
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<Meta name = "viewport" content = "width = device-width, initial-scale = 1"/>
<Link href = "Css/jquery.mobile-1.2.0.min.css" rel = "Stylesheet" type = "text/css"/>
<Script src = "Js/jquery-1.8.3.min.js" type "text/javascript"> </script>
<Script src = "Js/jquery. mobile-1.2.0.min.js" type = "text/javascript"> </script>
</HEAD>
<BODY>
<Section id = "page1" data-role = "page" data-add-back-btn = "true">
<Header data-role = "header"> <Div data-role = "content" class = "content">
<P> 3I Studio is a technical team dedicated to entrepreneurial innovation </p> |
</Div>
<Footer data-role = "footer"> </Section>
</BODY>
</HTML>

3. Preview:

Click 3i Studio for external links:

4. If the previous page is returned, add the data-rel attribute to the <a> label and set the attribute to back, for example: <a data-rel = "back"> return to the previous page </a>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.