Accidentally access or set cookies from the 163 web site, log to the log to prevent forgetting
Cookie function Check
function Fcheckcookie () {
if (!navigator.cookieenabled) {
Alert ("Hello, your browser settings prohibit use of cookie\n please set your browser, enable the cookie feature, and then login again.") ");
}
}
//Get cookie
function Fgetcookie (sName) {
var ssearch = sName + "=";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf ( Ssearch)
if (offset! = 1) {
Offset + = Ssearch.length;
end = Document.cookie.indexOf (";", offset)
if (end = =-1) end = Document.cookie.length;
return unescape (document.cookie.substring (offset, end))
else Return ""
}
}
Set cookies
function Fsetcookie (name, value, Isforever, domain) {
var sdomain = ";d omain=" + (Domain | | goption["Scookiedomain"]);
Document.cookie = name + "=" + Escape (value) + Sdomain + (isforever? "; Expires= "+ (new Date (2099,12,31)). toGMTString ():" ");
}
/cross-Domain call method
function Fgetscript (sURL) {
var oscript = document.createelement ("script");
Oscript.setattribute ("type", "Text/javascript");
Oscript.setattribute ("src", surl);
Try{oscript.setattribute ("Defer", "defer");} catch (e) {}
Window.document.body.appendChild (Oscript);
}
JS method of accessing or setting cookies + cross-domain calling method