作者poototo (poototo)
看板Ajax
标题[问题] 没有资料库,同站内跨html互抓
时间Thu Mar 13 13:31:48 2014
A.html里临时计算产生的一个数值 N=100
如何在页面跳转至B.html时,B.html仍能抓得到 N 继续处理?
没有後台
请问版友这可能做到吗?
Thx
0313
--
You love playing with that.
You love playing with all your stuffed animals.
You love your mommy,your daddy,your nature pajamas.
You love everything,don't you?
Yeah,
You know what,buddy?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.124.218.232
1F:推 LaPass:怎麽产生的? js? 那用#去传递即可 03/13 14:26
2F:→ mrbigmouth:cookie or local storage 03/13 14:35
3F:→ mrbigmouth:丢在网址参数js也一样抓的到啊 後台能抓到的东西js就 03/13 14:35
4F:→ mrbigmouth:抓的到 03/13 14:35
5F:→ mrbigmouth:location.search抓?後的参数 location.hash抓#後参数 03/13 14:36
6F:→ poototo:谢谢,是js产生的,只是类似购物车要记录勾选项目跟总价 03/14 05:06
7F:→ poototo:然後在另一个网页列出购买清单,所以要传很多数值 03/14 05:07
8F:→ poototo:抱歉没讲清楚,如果我已经组织好这些数值,阵列或物件 03/14 05:08
9F:→ poototo:有办法传吗?不然要拆开用#传,hash抓到又要重新组织一次 03/14 05:09
10F:推 mrbigmouth:阵列或物件可以用json+url encode然後丢网址/cookie 03/14 08:55
11F:→ mrbigmouth:网页与网页间的沟通目前只能以字串为主 不管是什麽方 03/14 08:56
12F:→ mrbigmouth:式的沟通,在网路上传输时终究还是变成字串 03/14 08:57
13F:→ danny8376:不一定要拆开啊 你可以串丢到#後面就好了啊... 03/14 16:25
14F:→ poototo:我的意思就是拆成一个字串 03/15 13:14
15F:推 kiwatami:两页合并成一页不要跳转呢? 03/16 12:47