后端api.php,用于对客户端请求进行处理

<?php
  include_once( 'api.function.php' );
  header("Content-type:application/json");
  header("Access-Control-Allow-Origin: *");
  $action = $_GET['action'];
  if($action == "" || $action == NULL)
  {
    SendReply(ERR_GENERAL,"");
  }
  else if(!function_exists($action))
  {
    SendReply(ERR_GENERAL,"");
  }
  call_user_func($action);

  function hello_world()
  {
    
阅读更多

jQuery垂直居中

if ($(".ClassName").height() = $(window).height()) $(".ClassName").css("marginTop",$(window).height()/2 - $(".ClassName").height()/2);

jQuery iframe高度自适应

$(document).ready(
  function()
  {
    $(window).resize(function(){$(".iframeName").height($(window).height());});
    $(".iframeName").load(function(){$(this).height($(window).height());});
  }
);
阅读更多