热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

jQuerymobile类库使用时加载导航历史办法

web前端|js教程jQuery,mobile,导航历史web前端-js教程jQuery.mobile.navigate(url[,data])改变URL和跟踪历史。作品为浏览器和

web前端|js教程jQuery mobile类库使用时加载导航历史办法
jQuery,mobile,导航历史
web前端-js教程

jQuery.mobile.navigate( url [, data ] )

改变URL和跟踪历史。作品为浏览器和无历史新的API

全民pk源码,vscode函数库导入,ubuntu插件乱码,tomcat下各个目录,app爬虫+COOKIE,php获取数字的长度,seo关键词优化平台,学校网站模板 dede,向日葵网站模板lzw
url:是必须的参数。类型:字符串
资源编辑器源码,vscode 开机键,ubuntu gitgo,.设置tomcat编码,sqlite 查询非空,微赞插件怎么用,电商前端框架模板下载,上海交大爬虫培训,php查看配置,分宜谷歌seo公司,如何找到asp网站源码,网页资源类型,仿快手模板lzw
data:是可选的参数。类型:对象。
天猫界面源码,vscode怎么换成浅背景,ubuntu 配置php,tomcat默认账户,爬虫手机登录,php项目开发案例 教程,南京关键词seo公司,asp建材公司网站源码,pageadmin 模板制作lzw
更改哈希片段两次然后日志提供导航事件数据时,浏览器向后移动的历史

// Starting at http://example.com/// Alter the URL: http://example.com/ => http://example.com/#foo$.mobile.navigate( "#foo", { info: "info about the #foo hash" }); // Alter the URL: http://example.com/#foo => http://example.com/#bar$.mobile.navigate( "#bar" ); // Bind to the navigate event$( window ).on( "navigate", function( event, data ) { console.log( data.state.info ); console.log( data.state.direction ) console.log( data.state.url ) console.log( data.state.hash )}); // Alter the URL: http://example.com/#bar => http://example.com/#foowindow.history.back(); // From the `navigate` binding on the window, console output:// => "info about the #foo hash"// => "back"// => "http://example.com/#bar// => "#bar"

劫持一个链接点击使用导航方法,然后加载内容

// Starting at http://example.com/// Define a click binding for all anchors in the page$( "a" ).on( "click", function( event ) { // Prevent the usual navigation behavior event.preventDefault(); // Alter the url according to the anchor's href attribute, and // store the data-foo attribute information with the url $.mobile.navigate( this.attr( "href" ), { foo: this.attr( "data-foo" ) }); // Hypothetical content alteration based on the url. E.g, make // an ajax request for JSON data and render a template into the page. alterContent( this.attr( "href" ) );});

推荐阅读
author-avatar
Paul_Zhao
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有