Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery.load()帮助已更新_Jquery_Html - Fatal编程技术网

jQuery.load()帮助已更新

jQuery.load()帮助已更新,jquery,html,Jquery,Html,我仍在学习jQuery,所以我不知道这里发生了什么,但我使用了一个在css技巧中找到的过滤脚本,并试图在单击时将内容加载到divs中,但我在url中没有定义 我在页面中不受过滤脚本影响的部分执行了这项操作,它起到了作用,所以我只需要找出什么是冲突的 谁能帮帮我吗 这是我在div中加载内容的jQuery: 这是html: <div id="target"> <div class="sixteen columns clearfix thumbnail photoeditor

我仍在学习jQuery,所以我不知道这里发生了什么,但我使用了一个在css技巧中找到的过滤脚本,并试图在单击时将内容加载到divs中,但我在url中没有定义

我在页面中不受过滤脚本影响的部分执行了这项操作,它起到了作用,所以我只需要找出什么是冲突的

谁能帮帮我吗

这是我在div中加载内容的jQuery:

这是html:

<div id="target">
    <div class="sixteen columns clearfix thumbnail photoeditor">
        <div class="two-thirds columns alpha">
            <img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" />
        </div>
        <div class="one-third columns omega">
            <span class="title">Title goes here</span>
            <span class="details">Description goes here</span>
        </div>
    </div>
</div>
任何帮助都会非常好。谢谢

编辑:或者我尝试:

$(document).ready(function(){

$('#target').click(function(){

var link = $(this).attr('rel');
event.preventDefault();
$('#target').empty();
$('#target').load(link);

});
});
使用html:

<div id="target" class="sixteen columns clearfix thumbnail photoeditor" rel="404.html">
<div class="two-thirds columns alpha">
<img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" /></div>
<div class="one-third columns omega">
<span class="title">Title goes here</span>
<span class="details">Description goes here</span>
</div>
</div>
和HTML:

<div id="main-content">
<ul class="tabs-content">
<li class="active" id="portfolio">


<ul id="catpicker">
<li class="active"><a href="#" id="allcat" class="current">View All</a></li>
<li><a href="#" id="photoeditor" class="filter">Photo Editor</a></li> 
<li><a href="#" id="producer" class="filter">Producer</a></li></ul>

<div class="sixteen columns thumbnail photoeditor" rel="project1.html">
<div class="two-thirds columns alpha">
<img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" /></div>
<div class="one-third columns omega">
<span class="title">Project 1</span>
<span class="details">Details go here</span>
</div>
</div>

<div class="sixteen columns thumbnail photoeditor" rel="project2.html">
<div class="two-thirds columns alpha">
<img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" /></div>
<div class="one-third columns omega">
<span class="title">Project 2</span>
<span class="details">Details go here</span>
</div>
</div>

<div class="sixteen columns thumbnail photoeditor" rel="project3.html">
<div class="two-thirds columns alpha">
<img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" /></div>
<div class="one-third columns omega">
<span class="title">Project 3</span>
<span class="details">Details go here</span>
</div>
</div>


</li>
<li id="words">
</li>
</ul>
</div><!-- main content --> 

我在“防止默认”行中出错,这是因为您忘记在事件中传递。将事件传递给。按如下方式单击函数

$('#target').click(function(event)

在那之后,它对我起了作用。

我在“防止默认”行上出错,这是因为您忘记在事件中传递。将事件传递给。按如下方式单击函数

$('#target').click(function(event)
在那之后,它对我起了作用

<div id="main-content">
<ul class="tabs-content">
<li class="active" id="portfolio">


<ul id="catpicker">
<li class="active"><a href="#" id="allcat" class="current">View All</a></li>
<li><a href="#" id="photoeditor" class="filter">Photo Editor</a></li> 
<li><a href="#" id="producer" class="filter">Producer</a></li></ul>

<div class="sixteen columns thumbnail photoeditor" rel="project1.html">
<div class="two-thirds columns alpha">
<img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" /></div>
<div class="one-third columns omega">
<span class="title">Project 1</span>
<span class="details">Details go here</span>
</div>
</div>

<div class="sixteen columns thumbnail photoeditor" rel="project2.html">
<div class="two-thirds columns alpha">
<img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" /></div>
<div class="one-third columns omega">
<span class="title">Project 2</span>
<span class="details">Details go here</span>
</div>
</div>

<div class="sixteen columns thumbnail photoeditor" rel="project3.html">
<div class="two-thirds columns alpha">
<img src="images/d1.png" class="scale-with-grid" alt="fieldlazer" /></div>
<div class="one-third columns omega">
<span class="title">Project 3</span>
<span class="details">Details go here</span>
</div>
</div>


</li>
<li id="words">
</li>
</ul>
</div><!-- main content --> 
$('#target').click(function(event)