小编lax*_*j11的帖子

关于jquery在一个类中的范围

我希望能够通过ajax调用info ['id'] ...

var setEditor = function()
{
    this.info = {
        'id' : 1    // <--------------- i want this
    };

    var cardEditor = function()
    {
        var status = {
            'touched' : false,
            'id' : 0
        };
        card.children('input').bind('focusout', function() {
            alert(this.info['id']);  // <----------------- through this
            $.ajax({
                type : 'POST',
                url : '../addcard',
                data : 'name=John&location=Boston',
                dataType : 'json',
                success: function(msg){
                    $('#rec').html(msg);
                }
            });
        });

    };
};

set = new setEditor();
Run Code Online (Sandbox Code Playgroud)

javascript jquery scope jquery-plugins

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

如何设置div的样式以使其与文本一起运行?

我想用文本做一个小的文本高度div运行.我的代码看起来像这样:

blah blah blah <div style="display:block; float: left; width: 100px">[IN A DIV]</div> blah
Run Code Online (Sandbox Code Playgroud)

它应该看起来像:

blah blah blah [IN A DIV] blah blah
Run Code Online (Sandbox Code Playgroud)

但它总是出现:

blah blah blah 
[IN A DIV]
blah blah
Run Code Online (Sandbox Code Playgroud)

html css

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

标签 统计

css ×1

html ×1

javascript ×1

jquery ×1

jquery-plugins ×1

scope ×1