dongsu3654 2013-01-16 00:13
浏览 34

在jsfiddle中使用jquery完全匹配的代码

First I want to say that the code in jsfiddle works exactly as I'm expecting. However, when I try to insert it in my page, it does not work. I am using

 get.ajax 

To move html with php a mysql data into a div named #latest-divs. I have a form with an

 input#search

button that gets val() when .bind('input property...) and checks if there is exact match in the child divs of #latest-divs. I call these child elements #latestblock If there is exact match, then the event should execute, which, as I mentioned above, works in the jsfiddle but dies on my site. I have attempted everything I could think of:

Load in php file Load from head Load from body Load with and without "CDATA" Change my jquery version My site is codefault (dot) org. The jsfiddle link is http://jsfiddle.net/gAnyM/10/. As of right now, I am loading the second part (random positioning of divs) from script/latest-topics.php and the first part in head, from index.php.
  • 写回答

2条回答 默认 最新

  • dounue1965 2013-01-16 00:17
    关注

    are you sure you have it inside a:

    $(document).ready( function() {
      // code here
    });
    

    ?

    The dom needs to be ready before you bind things

    jsfiddle adds this for you automatically

    评论

报告相同问题?

悬赏问题

  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多