Javascript jquery.avgrund弹出窗口。怎么称呼它?

Javascript jquery.avgrund弹出窗口。怎么称呼它?,javascript,php,jquery,popup,avgrund,Javascript,Php,Jquery,Popup,Avgrund,下面是我的php文件,名为invalid_file_popup.php,我已经为弹出窗口编写了所有代码,并用 <div class="buttons"> <a href="#" id="show" class="button left">Show it</a> </div> 这很好用。但是我想将它包含到另一个页面中,如果它在if-else语句中,则调用这个“show”函数。。有人知道怎么称呼它吗 无效的\u文件\u p

下面是我的php文件,名为invalid_file_popup.php,我已经为弹出窗口编写了所有代码,并用

    <div class="buttons">
    <a href="#" id="show" class="button left">Show it</a>
    </div>

这很好用。但是我想将它包含到另一个页面中,如果它在if-else语句中,则调用这个“show”函数。。有人知道怎么称呼它吗

无效的\u文件\u popup.php

<!doctype html>
<html>
<head>

<link href='http://fonts.googleapis.com/css?family=Headland+One|Open+Sans:400,300&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://labs.voronianski.com/media/style/reset.css">
<link rel="stylesheet" href="./css/invalid.css">
<link rel="stylesheet" href="./css/av_invalid.css">
</head>
<body>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">   
</script>
<script src="./js/jquery.avgrund.js"></script>
<script>
$(function() {
    $('#show').avgrund({
        height: 150,
        holderClass: 'custom',
        showClose: true,
        showCloseText: 'close',
        onBlurContainer: '.container',
        template: "<p>Error. Either all the correct required (*) fields were't entered or image file was invalid.</br></br>" +
        "File must be jpeg, jpg, pjpeg, x-png or png.</p>"          
    });
});
</script>
</body>
</html>
if(isset($_POST['submit'])){
if ((($image_type == "image/gif")
|| ($image_type == "image/jpeg")
|| ($image_type == "image/jpg")
|| ($image_type == "image/pjpeg")
|| ($image_type == "image/x-png")
|| ($image_type == "image/png"))
&& ($image_size < 205000)
&& in_array($extension, $allowedExts))
  {
  if ($_FILES["file"]["error"] > 0)
   {
   echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
  }
  else
   {
   echo "Upload: " . $image_name . "<br>";
   echo "Type: " . $image_type . "<br>";
   echo "Size: " . ($image_size / 1024) . " kB<br>";
   echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";
   // redirect somewhere

   if (file_exists("upload/" . $image_name))
     {
     // redirect somewhere and let user know it already exists
    echo $image_name . " already exists. ";
    }
   else
    {

    mysql_query("INSERT INTO Events (event_name, event_venue, event_info, event_price,     
    event_day, event_month, event_year, event_online, event_contact, image_name, image, 
    user_id) VALUES ('$event_name', '$event_venue', '$event_info', '$event_price', 
    '$event_day', '$event_month', '$event_year', '$event_online', '$event_contact', 
    '$image_name', '$image',".$_SESSION['id'].")");

  move_uploaded_file($_FILES["file"]["tmp_name"],
  "upload/" . $image_name);
  echo "Stored in: " . "upload/" . $image_name;
  echo "SUCCESSFULLY ADDED EVENT";

  $path = "/upload/$image_name";
  echo "<img src='".$path."' />";


 }
 }
  }
 else
{
 include "invalid_file_popup.php";
 // HAVE INCLUDED THE FILE NOW I WANT TO MAKE THE CALL!
}
}

$(函数(){
$(“#show”).avgrund({
身高:150,
holderClass:“自定义”,
showClose:没错,
showCloseText:“关闭”,
onBlurContainer:“.container”,
模板:“错误。未输入所有正确的必填(*)字段,或者图像文件无效。

”+ “文件必须是jpeg、jpg、pjpeg、x-png或png。

” }); });
在这段代码的底部,我想调用javascript函数,使其弹出。。我在其中包含了无效的\u文件\u popup.php

<!doctype html>
<html>
<head>

<link href='http://fonts.googleapis.com/css?family=Headland+One|Open+Sans:400,300&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://labs.voronianski.com/media/style/reset.css">
<link rel="stylesheet" href="./css/invalid.css">
<link rel="stylesheet" href="./css/av_invalid.css">
</head>
<body>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">   
</script>
<script src="./js/jquery.avgrund.js"></script>
<script>
$(function() {
    $('#show').avgrund({
        height: 150,
        holderClass: 'custom',
        showClose: true,
        showCloseText: 'close',
        onBlurContainer: '.container',
        template: "<p>Error. Either all the correct required (*) fields were't entered or image file was invalid.</br></br>" +
        "File must be jpeg, jpg, pjpeg, x-png or png.</p>"          
    });
});
</script>
</body>
</html>
if(isset($_POST['submit'])){
if ((($image_type == "image/gif")
|| ($image_type == "image/jpeg")
|| ($image_type == "image/jpg")
|| ($image_type == "image/pjpeg")
|| ($image_type == "image/x-png")
|| ($image_type == "image/png"))
&& ($image_size < 205000)
&& in_array($extension, $allowedExts))
  {
  if ($_FILES["file"]["error"] > 0)
   {
   echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
  }
  else
   {
   echo "Upload: " . $image_name . "<br>";
   echo "Type: " . $image_type . "<br>";
   echo "Size: " . ($image_size / 1024) . " kB<br>";
   echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";
   // redirect somewhere

   if (file_exists("upload/" . $image_name))
     {
     // redirect somewhere and let user know it already exists
    echo $image_name . " already exists. ";
    }
   else
    {

    mysql_query("INSERT INTO Events (event_name, event_venue, event_info, event_price,     
    event_day, event_month, event_year, event_online, event_contact, image_name, image, 
    user_id) VALUES ('$event_name', '$event_venue', '$event_info', '$event_price', 
    '$event_day', '$event_month', '$event_year', '$event_online', '$event_contact', 
    '$image_name', '$image',".$_SESSION['id'].")");

  move_uploaded_file($_FILES["file"]["tmp_name"],
  "upload/" . $image_name);
  echo "Stored in: " . "upload/" . $image_name;
  echo "SUCCESSFULLY ADDED EVENT";

  $path = "/upload/$image_name";
  echo "<img src='".$path."' />";


 }
 }
  }
 else
{
 include "invalid_file_popup.php";
 // HAVE INCLUDED THE FILE NOW I WANT TO MAKE THE CALL!
}
}
if(isset($\u POST['submit'])){
如果(($image_type==“image/gif”)
||($image_type==“image/jpeg”)
||($image_type==“image/jpg”)
||($image_type==“image/pjpeg”)
||($image_type==“image/x-png”)
||($image_type==“image/png”))
&&($image_size<205000)
&&in_数组($extension$allowedExts))
{
如果($\u文件[“文件”][“错误”]>0)
{
回显“返回代码:”.$\u文件[“文件”][“错误”]。
”; } 其他的 { echo“上传:.$image_name.”
“; 回声“类型:“.$image_类型”。
”; 回声“大小:”($image_Size/1024)。“kB
”; 回显“临时文件:”.$\u文件[“文件”][“tmp\u名称”]。
”; //重定向到某个地方 如果(文件_存在(“上载/”$image_名称)) { //重定向到某个地方,并让用户知道它已经存在 echo$image\u name。“已存在。”; } 其他的 { mysql_查询(“插入事件(事件名称、事件地点、事件信息、事件价格、, 事件日、事件月、事件年、事件在线、事件联系人、图像名称、图像、, 用户id)值(“$event\u name”、“$event\u vention”、“$event\u info”、“$event\u price”, “$event\u day”、“$event\u month”、“$event\u year”、“$event\u online”、“$event\u contact”, “$image\u name”、“$image”、“$\u SESSION['id']); 移动上传的文件($文件[“文件”][“tmp文件名”], “上传/”$image_name); echo“存储在:“.”upload/“$image\u name; echo“已成功添加事件”; $path=“/upload/$image\u name”; 回声“; } } } 其他的 { 包括“无效的\u文件\u popup.php”; //已经包括了文件,现在我想打电话! } }
一旦包含了该文件,就可以像在任何地方一样调用它。我不知道
avgrund
有什么作用,但您调用它应该不会有任何问题。但请记住,您包含的地方,该文件的所有代码都将被打印(如html、样式表等),这可能会与包含它的页面发生冲突。@ICanHasCheezburger,我该如何称呼它?我不想有一个按钮来叫它。。我只想在调用if语句时弹出它。明白吗?你可以试着将
$('#show').avgrund({})
包装到某个函数中,比如说
show_func()
,并在PHP中调用它作为
echo'show_func()