Home > Web Front-end > HTML Tutorial > Can the local cookies set by jQuery be accessed by other pages? _html/css_WEB-ITnose

Can the local cookies set by jQuery be accessed by other pages? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:43:32
Original
1350 people have browsed it

A small thing made using html and jquery needs to realize data sharing between pages


Reply to the discussion (solution)

Set the path path It's okay to be/is. But it must be a cookie under the same domain name

All pages under the scope can be accessed
http://www.cnblogs.com/chenqianpeng/archive/2012/04/24/2468642. html

uses html, a small thing made by jquery, and needs to realize data sharing between pages



if($('#materialId').val()! =0){
var materialId = $('#materialId').val();
$.cookie("A",AK[materialId][0],{path:'/'}); //Put the value of A into cookie
$.cookie("K",AK[materialId][1],{path:'/'});
alert($.cookie("A")) ;
//alert();
The value prompted is undefined I don’t know what went wrong I didn’t use the server at all
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template