duanhuo3392 2014-10-03 07:00
浏览 287

未找到。 在此服务器上找不到请求的URL /print_dokument.php


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.

  • 写回答

1条回答 默认 最新

  • douji5397 2014-10-03 07:32
    关注

    Opening the new window should contain a full URL. So something like this:

    var newwin = window.open('http://example.com/mydoc.php?'+filterstr,"_blank");
    

    That should work. Or, you can make it shorter on the current domain like this:

    var newwin = window.open('/mydoc.php?'+filterstr,"_blank");
    

    In your case the mysite.com is seen as a directory on the current domain, and not as a domain.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog