- jQuery Mobile Web Development Essentials(Third Edition)
- Raymond Camden Andy Matthews
- 247字
- 2021-07-09 20:22:18
jQuery Mobile, links, and you
When jQuery Mobile encounters a simple link (<a href="something.html">Foo</a>
), it will automatically capture any clicks on that link and change it to an AJAX-based load. This means that if it detects that the target is something on the same page, that is, the hashmark style (href="#foo"
) links we used in the previous code, it will handle transitioning the user to a new page. If it detects a page to another file on the same server, it will use AJAX to load the page and replace the currently visible one.
If you link to an external website, then jQuery Mobile will leave the link as it is and the normal link behavior will occur. There may be times when you may want to disable jQuery Mobile from doing anything with your links at all. In this case, you can make use of a data attribute that lets the framework know it shouldn't do anything at all. Here is an example:
<a href="foo.html" data-ajax="false">Normal, non-special link</a>
As we saw in Chapter 1, Preparing Your First jQuery Mobile Project, jQuery Mobile makes heavy use of data attributes. It is also very good at letting you disable the behaviors you don't like. As we continue in the book, you will see example after example of something jQuery Mobile does to enhance your website for mobile devices. In all of these cases though, the framework will recognize that there may be times when you may want to disable those features.
- Python量化投資指南:基礎(chǔ)、數(shù)據(jù)與實戰(zhàn)
- 自己動手實現(xiàn)Lua:虛擬機(jī)、編譯器和標(biāo)準(zhǔn)庫
- Koa開發(fā):入門、進(jìn)階與實戰(zhàn)
- Mastering ServiceNow(Second Edition)
- Python深度學(xué)習(xí):模型、方法與實現(xiàn)
- Java面向?qū)ο蟪绦蛟O(shè)計
- MongoDB,Express,Angular,and Node.js Fundamentals
- Regression Analysis with Python
- Qlik Sense? Cookbook
- Tableau Desktop可視化高級應(yīng)用
- Python全棧開發(fā):基礎(chǔ)入門
- Spring Boot從入門到實戰(zhàn)
- C語言程序設(shè)計教程
- Building Clouds with Windows Azure Pack
- Visual C++程序設(shè)計全程指南