我有一个需要多个主页的域名,我希望访问者选择他们的偏好,并使用JQuery在cookie中设置该首选项。我无法访问网站上的代码,因此需要使用jQuery或Javascript来完成。我不是程序员,但如果我有一个开端,我可以将事情拼凑在一起。
更多细节: www.domain.com/home www.domain.com/home2 www.domain.com/home3
User makes a choice from the above in a pulldown menu
Cookie is set marking their home page preference
User is redirected to their specific choice
Next time they visit www.domain.com the cookie is read and they are redirected to their preference
If no cookie exists, redirect to root or /home
答案 0 :(得分:0)
如果您无法访问网站上的代码,我不确定您要执行的操作"然而,#34;有一个域",但您可能会发现this jQuery cookie library有用。
至于重定向位,请查看here。