- 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.
- Mobile Web Performance Optimization
- 自己動(dòng)手寫搜索引擎
- Angular UI Development with PrimeNG
- Python神經(jīng)網(wǎng)絡(luò)項(xiàng)目實(shí)戰(zhàn)
- 人臉識(shí)別原理及算法:動(dòng)態(tài)人臉識(shí)別系統(tǒng)研究
- Learning Network Forensics
- Teaching with Google Classroom
- 大學(xué)計(jì)算機(jī)基礎(chǔ)實(shí)驗(yàn)指導(dǎo)
- OpenCV 4計(jì)算機(jī)視覺項(xiàng)目實(shí)戰(zhàn)(原書第2版)
- Tableau Dashboard Cookbook
- Python滲透測(cè)試編程技術(shù):方法與實(shí)踐(第2版)
- Thymeleaf 3完全手冊(cè)
- 熱處理常見缺陷分析與解決方案
- Slick2D Game Development
- Visual C++ 2017網(wǎng)絡(luò)編程實(shí)戰(zhàn)