小编Pau*_*bow的帖子

Fancybox的Javascript/Jquery回调是否确认

我正在尝试实现一种幻想是没有确认,我遇到问题让回调按需工作.以下示例使用Fancybox v2.

以下代码的问题是,当HREF单击"测试"并且在用户单击时未调用时,正在调用函数"do_something" #fancyConfirm_ok.

function fancyConfirm(msg,callback) {
    var ret;
    jQuery.fancybox({
        'modal' : true,
        'content' : "<div style=\"margin:1px;width:240px;\">"+msg+"<div style=\"text-align:right;margin-top:10px;\"><input id=\"fancyconfirm_cancel\" style=\"margin:3px;padding:0px;\" type=\"button\" value=\"Cancel\"><input id=\"fancyConfirm_ok\" style=\"margin:3px;padding:0px;\" type=\"button\" value=\"Ok\"></div></div>",
        'afterShow' : function() {
            jQuery("#fancyconfirm_cancel").click(function() {
                ret = false;
                //jQuery.fancybox.close();
                $.fancybox.close();
            })
            jQuery("#fancyConfirm_ok").click(function() {
                ret = true;
                jQuery.fancybox.close();
            })
        },
        'afterClose' : function() { 
            if (typeof callback == 'function'){ 
                callback.call(this, ret); 
            } else {
                var callback_type = typeof callback;
                alert(callback_type);
            }
        }
    });
}
<a href="#" onclick="fancyConfirm('Are you sure …
Run Code Online (Sandbox Code Playgroud)

javascript jquery fancybox

3
推荐指数
1
解决办法
1万
查看次数

REST API - 要PUT还是POST?

可能重复:
REST中的PUT与POST

我知道这已经讨论了很多,虽然我有点理解,但我并没有完全理解.我想如果有人可以通过以下示例回答这个问题,那么这将使其易于理解.

创建新用户 - 将新用户添加到发送用户名,密码,电子邮件的数据库.PUT还是POST?

我想也许是PUT,因为我不想拥有重复的用户,PUT就像删除和替换.但是,我有检查,以避免用户被添加两次,所以也许我应该使用POST?

更新用户 - 更改电子邮件或密码.PUT还是POST?

我可以使用URI api/update/my_username,然后通过正文发送新的电子邮件,那么这应该是PUT吗?我也可以在URI中发送它,例如api/update/my_username/email/new_email@email.com

rest

3
推荐指数
1
解决办法
4694
查看次数

如何在Codeigniter中将自定义错误处理程序设置为电子邮件错误

我对PHP和自定义错误处理程序的设置相当新,但我有一些代码在CI之外工作正常,但我无法弄清楚如何将它集成到CI控制器中.我收到错误"消息:未定义属性:错误:: $ my_error_handler"

我的控制器是:

<?php
class Errors extends CI_Controller {


    public function __construct()
    {
        parent::__construct();

    }

    function my_error_handler($number, $message, $file, $line, $vars)
    {
        $email = "
            <p>An error ($number) occurred on line
            <strong>$line</strong> and in the <strong>file: $file.</strong>
            <p> $message </p>";

        $email .= "<pre>" . print_r($vars, 1) . "</pre>";

        $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

        // Email the error to someone...
        error_log($email, 1, 'name@domain.com', $headers);

        // Make sure that you decide how to respond to errors (on the user's …
Run Code Online (Sandbox Code Playgroud)

php codeigniter

1
推荐指数
1
解决办法
8273
查看次数

如何在Windows 7上的XAMPP上使用Bitnami Wordpress安装

我是运营Xampp和Bitnami的新手,但据我所知,Bitnami为Wordpress提供了一键式安装工具,类似于我在网络主机上获得的设施.

Xampp正在运行,我已经安装了Bitnami,C:\xampp可以在Xampp Admin上的Applications项目下看到这个,但我看不到如何在新站点上安装Wordpress.

我已经尝试再次运行安装程序并使用路径C:\xampp\htdocs\my_new_site,我得到一个error说它不包含valid XAMPP installation.我该如何使用Bitnami?

xampp bitnami

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

bitnami ×1

codeigniter ×1

fancybox ×1

javascript ×1

jquery ×1

php ×1

rest ×1

xampp ×1