Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
调用PHP程序作为弹出覆盖?_Php_Javascript - Fatal编程技术网

调用PHP程序作为弹出覆盖?

调用PHP程序作为弹出覆盖?,php,javascript,Php,Javascript,我正在尝试使用fancybox iframe调用PHP程序,以从javascript程序作为登录页的一部分进行支付处理。该页面还调用另一个将日期写入文件的PHP程序。我试图模拟一次点击来启动fancybox函数,但始终没有成功。我一直收到这个错误-$a.hiddenclicker.fancybox不是函数。我不确定是要尝试将此逻辑添加到PHP文件中,还是想办法让fancybox正常工作。这是我的页面。对fancybox的调用是ProcessForm function WriteData(url)

我正在尝试使用fancybox iframe调用PHP程序,以从javascript程序作为登录页的一部分进行支付处理。该页面还调用另一个将日期写入文件的PHP程序。我试图模拟一次点击来启动fancybox函数,但始终没有成功。我一直收到这个错误-$a.hiddenclicker.fancybox不是函数。我不确定是要尝试将此逻辑添加到PHP文件中,还是想办法让fancybox正常工作。这是我的页面。对fancybox的调用是ProcessForm

function WriteData(url) {
var j1 = document.getElementById("hiddenclicker"); 

  var Request2 = false;  
  if (window.XMLHttpRequest) {
    Request2 = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    Request2 = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (Request2) {   
    Request2.open("GET", url, true); 
    Request2.onreadystatechange = function() {
      if (Request2.readyState == 4 && Request2.status == 200) {
              }
    }
    Request2.send(null);


  }
}


  function ProcessForm(form) {
    var j1 = document.getElementById("hiddenclicker"); 
    var firstname = "";
    var lastname = "";
    var payment = "";
    var email = "";
    var phone = "";
    var donation = "";
    firstname = form.firstname.value;
    lastname = form.lastname.value;
    email = form.email.value;
    phone = form.phone.value;
    donation = form.donation.value;
    if (firstname == "") {
        alert("You must fill in the first name");
        form.firstname.focus();
        return false;
                }
    else {
        if (lastname == "") {
            alert("You must fill in last name");
            form.lastname.focus();
            return false;
        }
    else {
        if (email == "") {
            alert("You must fill in email address");
            form.email.focus();
            return false; }
        }
    } 
    WriteData("writedata.php?firstname=" + firstname + "&lastname=" + lastname + "&email=" + email + "&phone=" + phone + "&donation=" + donation);


if (donation == "now") {

jQuery(document).ready(function(){
    $("a.hiddenclicker").fancybox(
    {
        'width' : 600,
        'height' : 400,
        'hideOnContentClick' : false,
        'type' : 'iframe'
    });
     });    
  j1.href = "http://www.ccyakids.org/donation_logic/donation_start.php#form";   
  $('#hiddenclicker').trigger('click'); 
}
}

//结束隐藏JavaScript语句->

触发hiddenclicker所需的HTML


隐藏点击器查看代码后,您可以通过两种不同的方式引用链接:

$("a.hiddenclicker") // class
$('#hiddenclicker') // ID
是哪一个?让它们都一样,我相信你的问题就会消失


希望这有帮助

我想我也需要这个来隐藏Clicker>隐藏Clicker页面上是否包含Jquery和fancybox?是否有用于进一步调试的链接?是否真的有你所建议的hiddenclicker类链接$a、 hiddenclickerHere是[link]@TimWickstrom.com,我让它们都$a.hiddenclicker,但仍然得到错误$a.hiddenclicker.fancybox不是函数。这个链接也是[link]@TimWickstrom.com。我发现这个问题,我没有包括所有需要的.js文件。现在覆盖很快就出现了,但是没有得到关注,我在覆盖中没有看到PHP程序。下面是.jQuerydocument.readyfunction{$a.php-overlay.fancybox{'width':600,'height':400,'hideOnContentClick':false,'type':'iframe'};};j1.href=;$'hiddenclicker'。触发'click';'代码'jQuerydocument.readyfunction{$a.php-overlay.fancybox{'width':600,'height':400,'hideOnContentClick':false,'type':'iframe'};};j1.href=;$'hiddenclicker'。触发'click';