小编Jar*_*ish的帖子

对于较大的可点击区域,如何将<a>标记设置为其父<li>标记的大小?

我想这样做,以便标签上的可点击区域的大小LI.

我的HTML看起来像:

<li>
 <a href="#">Link</a>
</li>
Run Code Online (Sandbox Code Playgroud)

html css

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

在IE 8或9中,负上边距不起作用

我有一个div margin-top:-200px.我希望div在它上方的div上方/后方移动.

到目前为止,IE以外的所有浏览器都很好用.margin-top:200px工作,所以我知道这不是一个崩溃的保证金问题.

有没有我不知道的错误?

css internet-explorer

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

Javascript数组原语是什么?字符串?对象?

数组只是伪装成对象吗?为什么/为什么不呢?他们以什么方式(这样/不是)?

我一直认为JS中的数组和对象基本相同,主要是因为访问它们是相同的.

var obj = {'I': 'me'};
var arr = new Array();
arr['you'] = 'them';

console.log(obj.I);
console.log(arr.you);
console.log(obj['I']);
console.log(arr['you']);
Run Code Online (Sandbox Code Playgroud)

我误导/错误/错误吗?关于JS文字,基元和字符串/对象/数组/等,我需要了解什么?

数组/对象是伪装的字符串吗?为什么/为什么不呢?他们以什么方式(这样/不是)?

javascript arrays javascript-objects

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

在另一个`<a>`里面有一个`<a>`可以吗?

如果我有一个指向另一个页面的链接,并且其中有另一个链接,那可以吗?在HTML5中是否允许,如果允许,哪些浏览器支持它?

在Chrome 14.0.835.202中尝试此操作,我看到左侧的文本被链接,然后是#1链接,但其余部分没有链接.

例:

<p>
 <a href="download?file=2">Example file.txt</a>
 [
  <a href="revision?file=2&id=8">This is an example revision that fixes bug 
   <a href="bug?file=2&id=1">#1</a>. 
   Version number updated.
  </a>
 ]
</p>
Run Code Online (Sandbox Code Playgroud)

html html5

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

PDF填写表单字段

我想在预制的PDF文档中填写表单字段,但是在运行时我收到了AcroForm的Null Refrence错误.

 string fileN4 = TextBox1.Text + " LOG.pdf";

  File.Copy(Path.Combine(textBox4.Text + "\\", fileN4),
               Path.Combine(Directory.GetCurrentDirectory(), fileN4), true);

  // Open the file
  PdfDocument document = PdfReader.Open(fileN4, PdfDocumentOpenMode.Modify);

  PdfTextField currentField = (PdfTextField)(document.AcroForm.Fields["<CASENUM>"]);
  //const 
        string caseName = TextBox1.Text;
  PdfString caseNamePdfStr = new PdfString(caseName);

  //set the value of this field
  currentField.Value = caseNamePdfStr;


  // Save the document...
  document.Save(fileN4);
Run Code Online (Sandbox Code Playgroud)

PdfTextField currentField = (PdfTextField)(document.AcroForm.Fields["<CASENUM>"]);错误发生的地方也是如此 .它接缝表明AcroForm甚至没有认识到这些领域.

另一种选择是在PDF中查找和替换文本(不使用由于许可而无法使用的itextsharp).

任何帮助都是极好的!

c# pdf pdfsharp

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

使用$ this代替$(this)可以提供性能提升吗?

假设我有以下示例:

例一

$('.my_Selector_Selected_More_Than_One_Element').each(function() {
    $(this).stuff();
    $(this).moreStuff();
    $(this).otherStuff();
    $(this).herStuff();
    $(this).myStuff();
    $(this).theirStuff();
    $(this).children().each(function(){
        howMuchStuff();
    });
    $(this).tooMuchStuff();
    // Plus just some regular stuff
    $(this).css('display','none');
    $(this).css('font-weight','bold');
    $(this).has('.hisBabiesStuff').css('color','light blue');
    $(this).has('.herBabiesStuff').css('color','pink');
}
Run Code Online (Sandbox Code Playgroud)

现在,它可能是:

例二

$('.my_Selector_Selected_More_Than_One_Element').each(function() {
    $this = $(this);
    $this.stuff();
    $this.moreStuff();
    $this.otherStuff();
    $this.herStuff();
    $this.myStuff();
    $this.theirStuff();
    $this.children().each(function(){
        howMuchStuff();
    });
    $this.tooMuchStuff();
    // Plus just some regular stuff
    $this.css('display','none');
    $this.css('font-weight','bold');
    $this.has('.hisBabiesStuff').css('color','light blue');
    $this.has('.herBabiesStuff').css('color','pink');
}
Run Code Online (Sandbox Code Playgroud)

这一点不是实际的代码,而是使用$(this)何时使用超过一次/两次/三次或更多次.

使用示例二而不是示例一,我的表现更好(可能有解释原因或原因)?

编辑/ NOTE

我怀疑两个是更好的一个; $this当我不可避免地忘记添加$this到事件处理程序时,我有点担心的是用我的代码加工而不是无意中引入了一个可能难以诊断的错误.我应该使用var $this = $(this),还是$this = $(this)为此?

谢谢! …

javascript jquery caching this

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

Mongo DB $或PHP查询

我无法弄清楚我的生活从or参数中选择一个集合.它对我来说根本不起作用,我无法在php上找到任何关于它的文档.

这是我的示例代码,即使它们存在于集合中也不会返回任何内容:

$cursor = $products->find(
    array(
        '$or' => array(
            "brand" => "anti-clothes",
            "allSizes" => "small"
        )
    )
);
Run Code Online (Sandbox Code Playgroud)

php find mongodb

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

jquery force click(href)

我有这个:

<li>
 <a href="#" data-content="visit">
  <span class="bf_hover"></span>
  <span>Visit us</span>
 </a>
</li>
Run Code Online (Sandbox Code Playgroud)

我想自动打开"访问我们"链接.

我怎么能这样做?

jquery href

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

跨域事件源

我正在尝试使用nodejs创建一个EventSource服务器,这将服务器跨域请求.我发送回Access-Control-Allow-Origin标题,但浏览器(也不是Chrome或Opera)不允许我连接.有我发回的标题:

this._response.writeHead(200, {
    'Content-Type': 'text/event-stream',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'Access-Control-Allow-Origin': '*',
    'Access-Control-Allow-Credentials': 'true'
});
Run Code Online (Sandbox Code Playgroud)

我怎么能以正确的方式做到这一点?

问候

cross-domain node.js cors

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

MySQL其中DateTime大于今天

我希望从我的MySQL数据库获得比今天更大的evry记录.

样品:

"Go to Lunch","2014-05-08 12-00-00"
"Go to Bed","2014-05-08 23-00-00"
Run Code Online (Sandbox Code Playgroud)

输出应该只:

"Go to Bed","2014-05-08 23-00-00"
Run Code Online (Sandbox Code Playgroud)

我使用DateTime作为日期列

已搜索过:

MySQL哪里的日期大于一个月?

MySQL中的日期时间等于或大于今天

但这对我不起作用.

QUERY(对于PHP):

SELECT `name`,`date` FROM `tasks` WHERE `tasks`.`datum` >= DATE(NOW())
Run Code Online (Sandbox Code Playgroud)

或(对于PhpMyAdmin)

SELECT `name`,`date` FROM `tasks` WHERE `tasks`.`datum` >= 2014-05-18 15-00-00;
Run Code Online (Sandbox Code Playgroud)

请帮我写一下工作查询.

mysql sql date

15
推荐指数
2
解决办法
10万
查看次数