내 CMS에서 데이터를 가져 와서 한 사람이 설문 조사에 투표하도록 허용하는 스크립트가 있습니다. 스크립트가 정상적으로 작동합니다. 그러나 Firefox에 Ad Block Plus Plugin이 설치되어 있습니다. 이 기능을 사용하면 스크립트가 양식을 올바르게 제출하지 못하도록 차단할 수 있습니다. 프런트 엔드에서 올바르게 제출하는 것처럼 보이지만 백엔드에는 등록되지 않습니다.광고 차단 플러스 jQuery 스크립트 차단?
광고 차단 플러스가 광고와 관련이없는 스크립트를 차단하는 이유는 무엇입니까?
스크립트
은 다음과 같습니다 : 내 스크립트가 차단되는 이유.aspx?zoneid=
이는 다음과 같습니다
이 easylist을 밝혀으로$(document).ready(function() {
var Engine = {
ui: {
buildChart: function() {
if ($("#pieChart").size() === 0) {
return;
}
var pieChartData = [],
totalVotes = 0,
$dataItems = $("ul.key li");
// grab total votes
$dataItems.each(function (index, item) {
totalVotes += parseInt($(item).data('votes'));
});
// iterate through items to draw pie chart
// and populate % in dom
$dataItems.each(function (index, item) {
var votes = parseInt($(item).data('votes')),
votePercentage = votes/totalVotes * 100,
roundedPrecentage = Math.round(votePercentage * 10)/10;
$(this).find(".vote-percentage").text(roundedPrecentage);
pieChartData.push({
value: roundedPrecentage,
color: $(item).data('color')
});
});
var ctx = $("#pieChart").get(0).getContext("2d");
var myNewChart = new Chart(ctx).Pie(pieChartData, {});
}, // buildChart
pollSubmit: function() {
if ($("#pollAnswers").size() === 0) {
return;
}
var $form = $("#pollAnswers"),
$radioOptions = $form.find("input[type='radio']"),
$existingDataWrapper = $(".web-app-item-data"),
$webAppItemName = $existingDataWrapper.data("item-name"),
$formButton = $form.find("button"),
bcField_1 = "CAT_Custom_1",
bcField_2 = "CAT_Custom_2",
bcField_3 = "CAT_Custom_3",
$formSubmitData = "";
$radioOptions.on("change", function() {
$formButton.removeAttr("disabled"); // enable button
var chosenField = $(this).data("field"), // gather value
answer_1 = parseInt($existingDataWrapper.data("answer-1")),
answer_2 = parseInt($existingDataWrapper.data("answer-2")),
answer_3 = parseInt($existingDataWrapper.data("answer-3"));
if (chosenField == bcField_1) {
answer_1 = answer_1 + 1;
$formSubmitData = {
ItemName: $webAppItemName,
CAT_Custom_1: answer_1,
CAT_Custom_2: answer_2,
CAT_Custom_3: answer_3
};
}
if (chosenField == bcField_2) {
answer_2 = answer_2 + 1;
$formSubmitData = {
ItemName: $webAppItemName,
CAT_Custom_1: answer_1,
CAT_Custom_2: answer_2,
CAT_Custom_3: answer_3
};
}
if (chosenField == bcField_3) {
answer_3 = answer_3 + 1;
$formSubmitData = {
ItemName: $webAppItemName,
CAT_Custom_1: answer_1,
CAT_Custom_2: answer_2,
CAT_Custom_3: answer_3
};
}
prepForm($formSubmitData);
});
function prepForm(formSubmitData) {
$formButton.click(function(e) {
e.preventDefault();
logAnonUserIn("anon", "anon", formSubmitData); // log user in
}); // submit
} // prepForm
function logAnonUserIn(username, password, formSubmitData) {
$.ajax({
type: 'POST',
url: '/ZoneProcess.aspx?ZoneID=-1&Username=' + username + '&Password=' + password,
async: true,
beforeSend: function() {},
success: function() {},
complete: function() {
fireForm(formSubmitData);
}
});
} // logAnonUserIn
function fireForm(formSubmitData) {
// submit the form
var url = "/CustomContentProcess.aspx?A=EditSave&CCID=13998&OID=3931634&OTYPE=35";
$.ajax({
type: 'POST',
url: url,
data: formSubmitData,
async: true,
success: function() {},
error: function() {},
complete: function() {
window.location = "/";
}
});
}
} // pollSubmit
} // end ui
};
Engine.ui.buildChart();
Engine.ui.pollSubmit();
});
크롬에서도 이러한 동작이 발생했습니다. 그것은 net :: ERR_BLOCKED_BY_CLIENT를 반환하지만, 나는 왜 그런지 모른다. – sdespont
스팸 메일이 아닌 "var"+1. 참고 : 파일 경로에/ad/폴더가 포함 된 이미지를 가져올 때 adBlockPlus와 같은 이런 종류의 문제가 발생했습니다 ... – nicolallias
아마도 쿼리 문자열/파일 이름의 일부가 adblocker 파일 필터의 규칙과 일치합니다. 명부. – epascarello