代码改变世界

随笔档案-2013年03月

firefox的cookie

2013-03-31 13:50 by 放作夥, 375 阅读, 收藏,
摘要: 如果不说明生存期,cookie有限期是浏览器会话(关闭浏览器时消失),IE,Chrome都按照预期删除掉cookie, 但是firefox则保留了cookie也就是逻辑上叫firefox在关闭浏览器后删除掉cookie, 但是firefox没有删除... 查看firefox的cookie, expires的值是:At the end of session ,但是关闭firefox重启后cookie还是有效的...另外:保存在硬盘上的cookie文件里的格式为关键名+值+具体作用域+"*",firefox的插件有修改cookie达到cookie欺骗的功能。 阅读全文

取出表单中元素的js代码

2013-03-30 16:35 by 放作夥, 294 阅读, 收藏,
摘要: -javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms;for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" 阅读全文

integer promotion

2013-03-17 20:46 by 放作夥, 343 阅读, 收藏,
摘要: 用小米的笔试题来举例吧1 void fun() 2 { 3 unsigned int a = 2013; 4 int b = -2; 5 int c = 0; 6 while (a + b > 0) 7 { 8 a = a + b; 9 c++; 10 } 11 printf("%d", c); 12 } 问输出什么?错误答案是1003,参考解释如下If both operands have the same type, then no further convers... 阅读全文