Пробвам се да направя една заявка към дб след натискане на бутон.
Като натисна бутона ми дава следната грешка:
Refused to set unsafe header "Connection"
Като зареда php файла директно в браузера ми показва резултатите.
[js]
function search_not(sender)
{
if(document.getElementById("not_result").style.display == 'none')
{
makePOSTRequestHead(virpath+"index.php?hp=1&m=notification&p=not",'', function()
{
focusNotificationsMenu(sender);
document.getElementById("not_result").style.display="";
global_menu="not_result";
});
}
else
{
document.getElementById("not_result").style.display = "none";
}
}
function makePOSTRequestHead(url) {
http_request_head = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request_head = new XMLHttpRequest();
if (http_request_head.overrideMimeType) {
http_request_head.overrideMimeType('text/html; charset=utf-8');
}
} else if (window.ActiveXObject) { // IE
try {
http_request_head = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request_head = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) { }
}
}
if (!http_request_head) { return false; }
http_request_head.open('POST', url, true);
http_request_head.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
http_request_head.setRequestHeader("Connection", "close");
http_request_head.send();
}[/js]
Като натисна бутона ми дава следната грешка:
Refused to set unsafe header "Connection"
Като зареда php файла директно в браузера ми показва резултатите.
HTML:
<div onclick="search_not(this);" style="cursor:pointer;height:45px;width:47px; z-index:200" id="menuNotOthers">
<table cellpadding="0" cellspacing="0" border="0" height="45" width="47" align="left" style="padding-bottom:4px;">
<tr>
<td align="center" valign="bottom">
<img src="images/header_not_black_off.png" border="0" />
</td>
</tr>
</table>
</div>
<div valign="bottom" style="top:0px;position:relative; z-index:200;">
<div id="not_result" style="position:absolute; display:none; left:0px;"></div>
</div>
[js]
function search_not(sender)
{
if(document.getElementById("not_result").style.display == 'none')
{
makePOSTRequestHead(virpath+"index.php?hp=1&m=notification&p=not",'', function()
{
focusNotificationsMenu(sender);
document.getElementById("not_result").style.display="";
global_menu="not_result";
});
}
else
{
document.getElementById("not_result").style.display = "none";
}
}
function makePOSTRequestHead(url) {
http_request_head = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request_head = new XMLHttpRequest();
if (http_request_head.overrideMimeType) {
http_request_head.overrideMimeType('text/html; charset=utf-8');
}
} else if (window.ActiveXObject) { // IE
try {
http_request_head = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request_head = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) { }
}
}
if (!http_request_head) { return false; }
http_request_head.open('POST', url, true);
http_request_head.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=utf-8");
http_request_head.setRequestHeader("Connection", "close");
http_request_head.send();
}[/js]