how to access angular js $rootscope in spring java application - javascript

$rootScope.loadAccountSubjects = function() {
if($rootScope.shaAccountId == undefined || $rootScope.shaAccountId == null) {
$rootScope.shaAccountId = $("#userInfo_userAccountId").val();
}
//console.log("in MenuController");
WidgetInfoService.getLandingPageByWidgetId({widgetId: $rootScope.widgetId}, function(response) {
var data = response.data;
if(data != null) {
$rootScope.institutionalPDAllowedStatus = data.allowInstitutionalPD;
$rootScope.isProxyEnable = data.isProxyEnabled;
$rootScope.isProxyRequestHealthDoc = data.canRequestHealthDoc;
$rootScope.canAccessPrivacyPreferences = data.canAccessPrivacyPreferences;
$rootScope.isPrivacySettingBannerSet = data.isPrivacySettingBannerSet;
$rootScope.isContactBannerSet = data.isContactBannerSet;
$rootScope.portalName = data.landingPageName;
$rootScope.portalNickName = data.nickName;
$scope.portalDateCreated = data.dateCreated;
$rootScope.pinRequired = data.pinRequired;
$rootScope.updatePrivacyPrefrences = data.updatePrivacyPrefrences;
/*for show-hide header*/
$rootScope.mydata = data.mydata;
$rootScope.documents = data.documents;
/*for show-hide header*/
$rootScope.setting_groups["1"] = "1_"+$rootScope.portalName;
$scope.lastUpdatedPreferenceDate = data.lastDateUpdatedForPreferences;
$scope.lastUpdatedAuthorizeAccountDate = data.lastDateUpdatedAuthorizeAccount;
$scope.lastUpdatedHealthDocumentDate = data.lastDateUpdatedHealthDocuments;
if(data.isMaleProfileImage && data.maleProfileImageName != null) {
$rootScope.defaultMaleProfileImage = $rootScope.amazonawsImgContextPath + "profileImage/" + data.maleProfileImageName;
}
if(data.isFemaleProfileImage && data.femaleProfileImageName != null) {
$rootScope.defaultFemaleProfileImage = $rootScope.amazonawsImgContextPath + "profileImage/" + data.femaleProfileImageName;
}
}
});
};
i want to use $rootScope.mydata = data.mydata;
$rootScope.documents = data.documents; these two variables in jsp page in ng-if how can i use it
<li id="mydata_id" class="link" onclick="changecolor('2')" ng-click="pleaseLoadViewAnswer();"><i class="fa fa-database" ng-if="mydata"></i><span>My Data</span></li>
i want to use $rootScope.mydata = data.mydata;
$rootScope.documents = data.documents; these in above html file

Related

How to send data to Zoho from wordpress via Javascript

I need to send data from a custom form to Zoho. I'm looking at the native javascript request in their documentation here.
https://www.zoho.com/crm/developer/docs/api/v2/insert-records.html
var listener = 0;
class InsertRecordsAPI {
async insertRecords() {
var url = "https://www.zohoapis.com/crm/v2/Leads"
var parameters = new Map()
var headers = new Map()
var token = {
clientId:"1000.NPY9M1V0XXXXXXXXXXXXXXXXXXXF7H",
redirectUrl:"http://127.0.0.1:5500/redirect.html",
scope:"ZohoCRM.users.ALL,ZohoCRM.bulk.read,ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,Aaaserver.profile.Read,ZohoCRM.org.ALL,profile.userphoto.READ,ZohoFiles.files.ALL,ZohoCRM.bulk.ALL,ZohoCRM.settings.variable_groups.ALL"
}
var accesstoken = await new InsertRecordsAPI().getToken(token)
headers.set("Authorization", "Zoho-oauthtoken " + accesstoken)
var requestMethod = "POST"
var reqBody = {"data":[{"Last_Name":"Lead_changed","Email":"newcrmapi#zoho.com","Company":"abc","Lead_Status":"Contacted"},{"Last_Name":"New Lead","Email":"newlead#zoho.com","Company":"abc","Lead_Status":"Contacted"}],"trigger":["approval","workflow","blueprint"]}
var params = "";
parameters.forEach(function(value, key) {
if (parameters.has(key)) {
if (params) {
params = params + key + '=' + value + '&';
}
else {
params = key + '=' + value + '&';
}
}
});
var apiHeaders = {};
if(headers) {
headers.forEach(function(value, key) {
apiHeaders[key] = value;
});
}
if (params.length > 0){
url = url + '?' + params.substring(0, params.length - 1);
}
var requestObj = {
uri : url,
method : requestMethod,
headers : apiHeaders,
body : JSON.stringify(reqBody),
encoding: "utf8",
allowGetBody : true,
throwHttpErrors : false
};
var result = await new InsertRecordsAPI().makeAPICall(requestObj);
console.log(result.status)
console.log(result.response)
}
async getToken(token) {
if(listener == 0) {
window.addEventListener("storage", function(reponse) {
if(reponse.key === "access_token" && (reponse.oldValue != reponse.newValue || reponse.oldValue == null)){
location.reload();
}
if(reponse.key === "access_token"){
sessionStorage.removeItem("__auth_process");
}
}, false);
listener = 1;
if(sessionStorage.getItem("__auth_process")) {
sessionStorage.removeItem("__auth_process");
}
}
["granted_for_session", "access_token","expires_in","expires_in_sec","location","api_domain","state","__token_init","__auth_process"].forEach(function (k) {
var isKeyExists = localStorage.hasOwnProperty(k);
if(isKeyExists) {
sessionStorage.setItem(k, localStorage[k]);
}
localStorage.removeItem(k);
});
var valueInStore = sessionStorage.getItem("access_token");
var tokenInit = sessionStorage.getItem("__token_init");
if(tokenInit != null && valueInStore != null && Date.now() >= parseInt(tokenInit) + 59 * 60 * 1000){ // check after 59th minute
valueInStore = null;
sessionStorage.removeItem("access_token");
}
var auth_process = sessionStorage.getItem("__auth_process");
if ((valueInStore == null && auth_process == null) || (valueInStore == 'undefined' && (auth_process == null || auth_process == "true"))) {
var accountsUrl = "https://accounts.zoho.com/oauth/v2/auth"
var clientId;
var scope;
var redirectUrl;
if(token != null) {
clientId = token.clientId;
scope = token.scope;
redirectUrl = token.redirectUrl;
}
var fullGrant = sessionStorage.getItem("full_grant");
var grantedForSession = sessionStorage.getItem("granted_for_session");
if(sessionStorage.getItem("__token_init") != null && ((fullGrant != null && "true" == full_grant) || (grantedForSession != null && "true" == grantedForSession))) {
accountsUrl += '/refresh';
}
if (clientId && scope) {
sessionStorage.setItem("__token_init", Date.now());
sessionStorage.removeItem("access_token");
sessionStorage.setItem("__auth_process", "true");
window.open(accountsUrl + "?" + "scope" + "=" + scope + "&"+ "client_id" +"=" + clientId + "&response_type=token&state=zohocrmclient&redirect_uri=" + redirectUrl);
["granted_for_session", "access_token","expires_in","expires_in_sec","location","api_domain","state","__token_init","__auth_process"].forEach(function (k) {
var isKeyExists = localStorage.hasOwnProperty(k);
if(isKeyExists){
sessionStorage.setItem(k, localStorage[k]);
}
localStorage.removeItem(k);
});
valueInStore = sessionStorage.getItem("access_token");
}
}
if(token != null && valueInStore != 'undefined'){
token.accessToken = valueInStore;
}
return token.accessToken;
}
async makeAPICall(requestDetails) {
return new Promise(function (resolve, reject) {
var body, xhr, i;
body = requestDetails.body || null;
xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.open(requestDetails.method, requestDetails.uri, true);
for (i in requestDetails.headers) {
xhr.setRequestHeader(i, requestDetails.headers[i]);
}
xhr.send(body);
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
resolve(xhr);
}
}
})
}
}
I need to send dynamic data and I'm a little fuzzy on how to use the async functions and populate the reqBody variable.
I have tried things like
makeAPICall(myjson);
.then((data) => { console.log(data)})
But I'm not getting anything returned. Any response is welcome. My thanks in advance.

Duplicating incident entity - MS CRM 2011 Incident entity

I'm trying to duplicate incident entity when click on a custom ribbon button. Everything is ok but i'm having problem with some fields. I'll share the code below.
When i remove the fields that made problem everything works fine, my web resource opens a new entity and populates fields. If i dont remove that fields im getting error. The odd situation is if i create another web resource with fields that i removed from my first Wresource it works fine too. Am i missing something or is there a field restriction ?
The code is working fine:
Comment outted section is making problem.
function test() {
if (Xrm.Page.data.entity.attributes.get("customerid").getValue() != null) {
var CustomerId = Xrm.Page.data.entity.attributes.get("customerid").getValue()[0].id;
var CustomerName = Xrm.Page.data.entity.attributes.get("customerid").getValue()[0].name;
var CustomerType = Xrm.Page.data.entity.attributes.get("customerid").getValue()[0].entityType;
}
if (Xrm.Page.data.entity.attributes.get("new_malzeme").getValue() != null) {
var MatNumbId = Xrm.Page.data.entity.attributes.get("new_malzeme").getValue()[0].id;
var MatNumbName = Xrm.Page.data.entity.attributes.get("new_malzeme").getValue()[0].name;
}
if (Xrm.Page.data.entity.attributes.get("new_satisburosu").getValue() != null) {
var SatBurId = Xrm.Page.data.entity.attributes.get("new_satisburosu").getValue()[0].id;
var SatBurName = Xrm.Page.data.entity.attributes.get("new_satisburosu").getValue()[0].name;
}
var Talep = Xrm.Page.data.entity.attributes.get("new_talep").getValue();
var ilgiliKisi = Xrm.Page.data.entity.attributes.get("new_ilgilikisi").getValue();
var UrunAdi = Xrm.Page.data.entity.attributes.get("new_urunadi").getValue();
var Zamanlama = Xrm.Page.data.entity.attributes.get("new_zamanlama").getValue();
var Email = Xrm.Page.data.entity.attributes.get("new_mail").getValue();
if (Xrm.Page.data.entity.attributes.get("new_siparis").getValue() != null) {
var SiparisId = Xrm.Page.data.entity.attributes.get("new_siparis").getValue()[0].id;
var SiparisName = Xrm.Page.data.entity.attributes.get("new_siparis").getValue()[0].name;
}
var Adet = Xrm.Page.data.entity.attributes.get("new_adet").getValue();
var Durumu = Xrm.Page.data.entity.attributes.get("incidentstagecode").getValue();
var telefon = Xrm.Page.data.entity.attributes.get("new_telefon").getValue();
var SrvOzt = Xrm.Page.data.entity.attributes.get("title").getValue();
if (Xrm.Page.data.entity.attributes.get("new_mhyetkilisi").getValue() != null) {
var MHyetkilisiId = Xrm.Page.data.entity.attributes.get("new_mhyetkilisi").getValue()[0].id;
var MHyetkilisiName = Xrm.Page.data.entity.attributes.get("new_mhyetkilisi").getValue()[0].name;
}
var islemBelgNo = Xrm.Page.data.entity.attributes.get("new_islembelgeno").getValue();
var Garanti = Xrm.Page.data.entity.attributes.get("new_garanti").getValue();
var SerTalTuru = Xrm.Page.data.entity.attributes.get("casetypecode").getValue();
var Sevkiyat = Xrm.Page.data.entity.attributes.get("new_sevkiyatsekli").getValue();
var SerAdrs = Xrm.Page.data.entity.attributes.get("new_servisadresi").getValue();
var Oncelik = Xrm.Page.data.entity.attributes.get("prioritycode").getValue();
var SemtIlce = Xrm.Page.data.entity.attributes.get("new_semt_ilce").getValue();
if (Xrm.Page.data.entity.attributes.get("new_sehir").getValue() != null) {
var SehirId = Xrm.Page.data.entity.attributes.get("new_sehir").getValue()[0].id;
var SehirName = Xrm.Page.data.entity.attributes.get("new_sehir").getValue()[0].name;
}
var TespitSnc = Xrm.Page.data.entity.attributes.get("new_tespitsonucu").getValue();
var HataKay = Xrm.Page.data.entity.attributes.get("new_mhhatakaynagi").getValue();
var HataAdi = Xrm.Page.data.entity.attributes.get("new_hatasebebi").getValue();
var HataliBrm = Xrm.Page.data.entity.attributes.get("new_hatalibirim").getValue();
var YplnHata = Xrm.Page.data.entity.attributes.get("new_hataadi").getValue();
var MHTop = Xrm.Page.data.entity.attributes.get("new_mhtoplanti").getValue();
var KapanisNdn = Xrm.Page.data.entity.attributes.get("new_kapansnedeni").getValue();
if (Xrm.Page.data.entity.attributes.get("new_satissor").getValue() != null) {
var SatSorId = Xrm.Page.data.entity.attributes.get("new_satissor").getValue()[0].id;
var SatSorName = Xrm.Page.data.entity.attributes.get("new_satissor").getValue()[0].name;
}
var Uygunsuzluk = Xrm.Page.data.entity.attributes.get("new_uygunsuzlukmaliyeti").getValue();
if (Xrm.Page.data.entity.attributes.get("new_departman").getValue() != null) {
var DepartmanId = Xrm.Page.data.entity.attributes.get("new_departman").getValue()[0].id;
var DepartmanName = Xrm.Page.data.entity.attributes.get("new_departman").getValue()[0].name;
}
var SerTalKay = Xrm.Page.data.entity.attributes.get("caseorigincode").getValue();
var SatFyt = Xrm.Page.data.entity.attributes.get("new_satisfiyati2").getValue();
if (Xrm.Page.data.entity.attributes.get("new_anketiyapan").getValue() != null) {
var AnketiYapanId = Xrm.Page.data.entity.attributes.get("new_anketiyapan").getValue()[0].id;
var AnketiYapanName = Xrm.Page.data.entity.attributes.get("new_anketiyapan").getValue()[0].name;
}
var AnketSonucu = Xrm.Page.data.entity.attributes.get("customersatisfactioncode").getValue();
var MusteriGors = Xrm.Page.data.entity.attributes.get("new_musterigorusleri").getValue();
var tekraronl = Xrm.Page.data.entity.attributes.get("new_tekraronleme").getValue();
var Aciklama = Xrm.Page.data.entity.attributes.get("description").getValue();
var parameters = {};
if (CustomerId != null && CustomerName != null) {
parameters["customerid"] = CustomerId;
parameters["customeridname"] = CustomerName;
parameters["customeridtype"] = CustomerType;
}
if (MatNumbId != null && MatNumbName != null) {
parameters["new_malzeme"] = MatNumbId;
parameters["new_malzemename"] = MatNumbName;
}
if (SatBurId != null && SatBurName != null) {
parameters["new_satisburosu"] = SatBurId;
parameters["new_satisburosuname"] = SatBurName;
}
if (Talep != null) {
parameters["new_talep"] = Talep;
}
if (ilgiliKisi != null) {
parameters["new_ilgilikisi"] = ilgiliKisi;
}
if (UrunAdi != null) {
parameters["new_urunadi"] = UrunAdi;
}
if (Zamanlama != null) {
parameters["new_zamanlama"] = Zamanlama;
}
if (Email != null) {
parameters["new_mail"] = Email;
}
if (SiparisId != null && SiparisName != null) {
parameters["new_siparis"] = SiparisId;
parameters["new_siparisname"] = SiparisName;
}
if (Adet != null) {
parameters["new_adet"] = Adet;
}
if (Durumu != null) {
parameters["incidentstagecode"] = Durumu;
}
if (telefon != null) {
parameters["new_telefon"] = telefon;
}
if (SrvOzt != null) {
parameters["title"] = SrvOzt;
}
if (MHyetkilisiId != null && MHyetkilisiName != null) {
parameters["new_mhyetkilisi"] = MHyetkilisiId;
parameters["new_mhyetkilisiname"] = MHyetkilisiName;
}
if (islemBelgNo != null) {
parameters["new_islembelgeno"] = islemBelgNo;
}
if (Garanti != null) {
parameters["new_garanti"] = Garanti;
}
if (SerTalTuru != null) {
parameters["casetypecode"] = SerTalTuru;
}
if (Sevkiyat != null) {
parameters["new_sevkiyatsekli"] = Sevkiyat;
}
if (SerAdrs != null) {
parameters["new_servisadresi"] = SerAdrs;
}
if (Oncelik != null) {
parameters["prioritycode"] = Oncelik;
}
if (SemtIlce != null) {
parameters["new_semt_ilce"] = SemtIlce;
}
if (TespitSnc != null) {
parameters["new_tespitsonucu"] = TespitSnc;
}
if (HataKay != null) {
parameters["new_mhhatakaynagi"] = HataKay;
}
if (HataAdi != null) {
parameters["new_hatasebebi"] = HataAdi;
}
if (HataliBrm != null) {
parameters["new_hatalibirim"] = HataliBrm;
}
if (YplnHata != null) {
parameters["new_hataadi"] = YplnHata;
}
if (MHTop != null) {
parameters["new_mhtoplanti"] = MHTop;
}
if (KapanisNdn != null) {
parameters["new_kapansnedeni"] = KapanisNdn;
}
/*if (SatSorId != null && SatSorName != null) {
parameters["new_satissor"] = SatSorId;
parameters["new_satissorname"] = SatSorName;
}*/
if (Uygunsuzluk != null) {
parameters["new_uygunsuzlukmaliyeti"] = Uygunsuzluk;
}
if (DepartmanId != null && DepartmanName != null) {
parameters["new_departman"] = DepartmanId;
parameters["new_departmanname"] = DepartmanName;
}
Xrm.Utility.openEntityForm("incident", null, parameters);
}

JQM, Phonegap, a server function crashes my app

I am developping an hybrid app (JQM 1.4 + Phonegap 3.6.3).
I have a function populateImagesUrlsLocalAndServer that checks if an image file exists on my server, but I can't use this function because it makes my app crash on Phonegap...
I can't find why.
Can you help me fix this issue so I can use this feature in my app again ?
Thank
function populateImagesUrlsLocalAndServer(str, baseUrl, type) {
if (connectionStatus == "online") {
if (UrlExists('./'+baseUrl+str)) { //local file
imagesUrls[str] = './'+baseUrl+str;
} else if (isPhoneGap && UrlExists('http://boardlineapp.com/app/'+baseUrl+str)) { //server file....we exclude this for desktop browser because of cross domain error
console.log('retrieving '+'http://boardlineapp.com/app/'+baseUrl+str+' on server')
imagesUrls[str] = 'http://boardlineapp.com/app/'+baseUrl+str;
} else {
imagesUrls[str] = './'+baseUrl+'default.png';
}
} else { //offline
if (UrlExists('./'+baseUrl+str)) { //local file
imagesUrls[str] = './'+baseUrl+str;
} else {
imagesUrls[str] = './'+baseUrl+'default.png';
}
}
imagesUrls[str+'type'] = type;
}
instead, for now I am using :
function populateImagesUrls(str, baseUrl, type) {
if ( str == 'byrne-ow-fender.png'
|| str == 'ci-tacogrinder.png'
|| str == 'noamizuno.png'
|| str == 'brendanmargieson.png'
|| str == 'kaihing.png'
|| str == 'dustinhollick.png'
|| str == 'dhd-thetwin.png'
) {
//console.log(str);
//console.log(baseUrl);
imagesUrls[str] = './'+baseUrl+'default.png';
} else {
imagesUrls[str] = './'+baseUrl+str;
}
imagesUrls[str+'type'] = type;
}
the function that calls it is the following:
function checkIfImagesExistAllAtOnce() {
var prodataTemp = [];
prodataTemp = prodata.slice();
prodataTemp.shift();
prodataTemp.sort(sort_by('brand', 'name', 'model'));
var strBrandDone;
var strNameDone;
var strModelDone;
for (i = 1; i < prodataTemp.length; ++i) {
//check brand
var str = prodataTemp[i]['brand'].replace(/\s+/g, '').toLowerCase();
str = str+'.png';
if (str != strBrandDone) {
var baseUrl = "images/brands/";
strBrandDone = str;
var type = "brand";
populateImagesUrls(str, baseUrl, type);
//populateImagesUrlsLocalAndServer(str, baseUrl, type);
}
//check pro image
var str = prodataTemp[i]['name'].replace(/\s+/g, '').toLowerCase();
str = str+'.png';
if (str != strNameDone) {
var baseUrl = "images/pros/";
strNameDone = str;
var type = "pro";
populateImagesUrls(str, baseUrl, type);
//populateImagesUrlsLocalAndServer(str, baseUrl, type);
}
//check board image
var str = prodataTemp[i]['imageName'];
if (str != strModelDone) {
var baseUrl = "images/boards/";
strModelDone = str;
var type = "board";
populateImagesUrls(str, baseUrl, type);
//populateImagesUrlsLocalAndServer(str, baseUrl, type);
}
}
prodataTemp = null;
}

JavaScript TypeError: top.frames.plrf is undefined and Error: Permission denied to access property 'PM'

I have 2 files:
Ruins.js,
RuinsMap.loc.js
The code is pretty big, so I put a link on both files.
The script that runs both files is:
var RuinsPl = function() {
this.help = "#";
this.name = "Руины";
this.id = "Ruins";
this.master = null;
this.menuitem = null;
this.created = false;
this.enabled = true;
this.enabled = true;
this.options = {map: 0, loc: 0, profile: ""};
this.RuinsFrame = 0;
this.contentHTML = "";
this.Start = function(win) {
var This = this;
if (win.document.URL.indexOf("/ruines.php") != -1) {
win.document.getElementById('ione').style.display = "none";
}
if ((win.document.URL.indexOf("/ruines.php") != -1 || (win.document.URL.indexOf("/fbattle.php") != -1 && this.options.map > 0)) && !this.RuinsFrame) {
if (win.document.URL.indexOf("/ruines.php") != -1) {
var regex = /(\d{6,10})" target="_blank">Лог турнира/;
var res = win.document.body.innerHTML.match(regex);
if (res && res.length > 1) {
this.options.map = res[1];
}
this.master.SaveOptions();
}
this.RuinsFrame = 1;
top.document.getElementsByName("main")[0].outerHTML = '<frameset name="ruins" framespacing="0" border="0" frameborder="0" cols="*,400">' +
' <frame name="main" src="main.php?top=' + Math.random() + '">' +
' <frame name="rmap" src="refreshed.html">' +
'</frameset>';
} else if (win.document.URL.indexOf("/ruines_start.php") != -1 && this.RuinsFrame) {
this.RuinsFrame = 0;
top.document.getElementsByName("ruins")[0].outerHTML = '<frame name="main" src="main.php?top=' + Math.random() + '">';
}
if (win.document.URL.indexOf("/ruines_start.php") != -1 && this.options.map > 0) {
this.options.map = 0;
this.master.SaveOptions();
}
if (this.options.map > 0 && this.RuinsFrame) {
var html_doc = win.document.getElementsByTagName("head");
if (html_doc.length > 0)
html_doc = html_doc[0];
else
html_doc = win.document.body;
var js_plugin = win.document.createElement("script");
js_plugin.setAttribute("type", "text/javascript");
js_plugin.setAttribute("src", "http://old-proxy.info/dark/Ruins.js?" + Math.random());
js_plugin.setAttribute("charset", "utf-8");
html_doc.appendChild(js_plugin);
js_plugin = null;
}
}
this.ApplyOptions = function() {
var This = this;
if (this.master != null) {
$(this.master.global_options).each(function() {
if (this.id == This.id) {
if (this.enabled)
This.Enable();
else
This.Disable();
if (!$.isEmptyObject(this.value))
This.options = this.value;
else
This.options = {map:0};
}
})
}
}
this.Enable = function() {
this.enabled = true;
var mi = this.MenuItem();
if (mi != null) {
mi.removeClass("input_pl_off");
}
}
this.Disable = function() {
this.enabled = false;
var mi = this.MenuItem();
if (mi != null) {
mi.addClass("input_pl_off");
}
}
this.MenuItem = function() {
if (this.master != null && this.menuitem == null) {
var This = this;
This.mid = this.master.menu_id;
This.cid = this.master.content_id;
var menu_item = $('<input type="button" value="Руины"/>');
menu_item.bind('click', function() {
if (This.master.Current != This) {
This.master.Current.Dispose();
}
This.master.Current = This;
$(this).css("background-color", "#f0f0f0");
This.ToggleContent();
})
this.menuitem = $(menu_item);
return this.menuitem;
} else
return this.menuitem;
}
this.ToggleContent = function() {
var This = this;
if (!this.created) {
$(this.cid).html(this.contentHTML);
this.created = true;
} else {
$("#ruins_options").toggle();
}
this.master.ResizeFrame();
}
this.Dispose = function() {
this.created = false;
this.MenuItem().css("background-color","");
}
}
http://www.old-proxy.info/dark/RuinsMap.loc.js
and /dark/Ruins.js
(it's a plugin for a game)
I get the next errors: http://clip2net.com/s/6PL9Wc
TypeError: top.frames.plrf is undefined
top.frames.plrf.RefreshMap(loc);
and this one:
Error: Permission denied to access property 'plugin'
if(typeof(top.frames['plugin'])=='undefined')
in LoadEvent.js insert document.domain = "oldbk.com";

How to check if cookies are blocked using JavaScript

How can I check if cookies are being blocked using JavaScript?
Write a cookie and then read it...
for example:
function readCookie(cname) {
a = trim(document.cookie);
res = '';
while(a != '') {
cookiename = a.substring(0,a.search('='));
cookiewert = a.substring(a.search('=')+1,a.search(';'));
if(cookiewert == '' || a.search(';')==-1) {
cookiewert = a.substring(a.search('=')+1,a.length);
} else {
cookiewert = a.substring(a.search('=')+1,a.search(';'));
}
if(cname == trim(cookiename)){
res = cookiewert;
return (res);
}
i = a.search(';')+1;
if(i == 0){i = a.length}
a = a.substring(i,a.length);
}
return(res)
}
function checkSessionCookie() {
//write cookie
document.cookie = 'sessioncookieallowed=true;';
var check = readCookie('sessioncookieallowed');
}
call function checkSessionCookie();

Categories