I want to display filtered data from my database table named "table1" (criteria: id,date1,date2), using javascript/jquery script. Results must be shown in new window. Everything is ok to the moment when new window is opened. Then, the error occurs as follow:
Not Found
The requested URL /mydoc.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
My code:
function ShowMyDocument(){
$.get("date_dialog.php",function(data){
$("#myDiv").html(data);
ShowDate('date2'); //set default date to input field "date2"
var dat=new Date();
dat.setDate(1);
SetMyDate(dat,'date1'); //set default date to input field "date1"
$("#date1").focus(); //for change date interval
$("#myDiv").dialog('option','buttons',{
"Show data": function(){
var id=document.getElementById('id').innerHTML;
var d1=mysqldate($("#date1").val());
var d2=mysqldate($("#date2").val());
var filterstr=encodeURIComponent("ID="+id+"&DATE1="+d1+"&DATE2="+d2);
$("#myDiv").dialog("close");
This is problematic instruction
var newwin = window.open('mysite.com/mydoc.php?'+filterstr,"_blank");
I'm try different options "mydoc.php", full path/mydoc.php and nothing changes.
},
"Cancel": function(){
$("#myDiv").dialog("close");
}
});
$("#myDiv").dialog('open');
});
}
NOTE: PHP file "mydoc.php" 100% exist in root folder of mysite.com.