Jquery插件知识之Jquery.cookie实现页面传值
来源:互联网 发布:2016总决赛 知乎 编辑:程序博客网 时间:2024/05/20 13:18
<span style="color:#ff0000;">//login.html页面</span>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script src="jquery-1.8.3.min.js" type="text/javascript"></script><script src="jquery.cookie.js" type="text/javascript"></script><script>$(document).ready( function(){$("#btnOk").click(function(){//存放刚才的zhang.laoshi信息;//$.cookie('user',$("#user").val()); //user:存放信息key;value//alert($("#meiniu").attr("src"));$.cookie('src',$("#meiniu").attr("src"));});});</script></head><body><form id="form1" name="form1" method="post" action="success.html" ><!--action提交到某个页面;get:提交方式?user='zhang' and pwd='123'--> <table width="800" border="0" align="center"> <tr> <td width="65">用户:</td> <td width="613"><input type="text" name="user" id="user" /></td> <td width="108"> </td> </tr> <tr> <td>图片</td> <td><img src="meiniu.jpg" width="118" height="79" id="meiniu" /></td> <td> </td> </tr> <tr> <td><input type="submit" name="button" id="btnOk" value="提交" /></td> <td><input type="reset" name="button2" id="button2" value="重置" /></td> <td> </td> </tr> </table></form></body></html>
//2.提交之后的success.html页面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script src="jquery-1.8.3.min.js" type="text/javascript"></script><script src="jquery.cookie.js" type="text/javascript"></script><script>$(document).ready(function(){//显示到div里面;//$("#content").html($.cookie('user')); //html:相当于div的innerHTMLvar s=$.cookie('src');$("#meiniu").prop("src",s);});</script></head><body><div id="content" style="border:1px solid #f00; width:600px; height:300px;"><img id="meiniu" src="" width="118" height="79"/></div></body></html>
0 0
- Jquery插件知识之Jquery.cookie实现页面传值
- jQuery插件之Cookie
- jQuery插件之Cookie
- jQuery插件之Cookie
- jQuery插件之Cookie
- jQuery插件之Cookie
- JQuery插件之Cookie
- jQuery插件之Cookie
- jQuery.cookie插件 cookie
- jQuery.cookie插件 cookie
- jQuery插件 -- Cookie插件
- jQuery插件 -- Cookie插件jquery.cookie.js
- jQuery插件 -- Cookie插件jquery.cookie.js
- jQuery插件 -- Cookie插件jquery.cookie.js
- jQuery插件 -- Cookie插件jquery.cookie.js
- jQuery之换肤与cookie插件
- JQuery 插件:、jQuery.Cookie.js
- 使用jquery插件【jquery.cookie】,实现【记住我】功能
- 尾部的零
- AsyncTask异步交互的用法简介
- Android 屏幕(View)坐标系统
- IntelliJ IDEA 使用心得与常用快捷键
- Java并发编程:Lock
- Jquery插件知识之Jquery.cookie实现页面传值
- Xcode LLDB Debug教程
- Lucene学习总结之六:Lucene打分公式的数学推导
- CentOS 6.4 编译安装 gcc 4.8.1
- SMBIOS介绍(1):概述
- 多线程求行列式值
- 颜色总结
- [java源码分析]LinkedList源码分析
- [Java] Java 中的进程与线程