jquery问题 初学

jenny0810 2010-01-15 10:57:52
大家好:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="css01.css" />
<script language="javascript" type="text/javascript" src="../jquery-1[1].3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="js01.js"></script>
</head>

<body>
<h1 id="f-title">Flatland: A Romance of Many Dimensions</h1>
<div id="f-author">by Edwin A. Abbott</div>
<h2>Part 1, Section 3</h2>
<h3 id="f-subtitle">Concerning the Inhabitants of Flatland</h3>
<div id="excerpt">an excerpt</div>

<div class="chapter">
<p class="square">Our Professional Men and Gentlemen are Squares
(to which class I myself belong) and Five-Sided Figures or <a
href="http://en.wikipedia.org/wiki/Pentagon">Pentagons</a>.
</p>

<p class="nobility hexagon">Next above these come the Nobility, of
whom there are several degrees, beginning at Six-Sided Figures,
or <a href="http://en.wikipedia.org/wiki/Hexagon">Hexagons</a>,
and from thence rising in the number of their sides till they
receive the honourable title of <a href="http://en.wikipedia.org/
wiki/Polygon">Polygonal</a>, or many-Sided. Finally when the
number of the sides becomes so numerous, and the sides themselves
so small, that the figure cannot be distinguished from a <a
href="http://en.wikipedia.org/wiki/Circle">circle</a>, he is
included in the Circular or Priestly order; and this is the
highest class of all.
</p>

<p><span class="pull-quote">It is a <span class="drop">Law of
Nature</span> with us that a male child shall have <strong>one
more side</strong> than his father</span>, so that each
generation shall rise (as a rule) one step in the scale of
development and nobility. Thus the son of a Square is a Pentagon;
the son of a Pentagon, a Hexagon; and so on.
</p>
<!-- . . . code continues . . . -->

</div>
</body>
</html>


$(document).ready(function() {
$('div.chapter a[href*=wikipedia]').each(function(index) {
var $thisLink = $(this);
$thisLink.attr({
'rel': 'external',
'id': 'wikilink-' + index,
'title': 'learn more about ' + $thisLink.text() + ' at Wikipedia'
});
});
});


.chapter {
font-size: 1.5em;
color:#FF0000;
}

这是用JQUERY写的一个简单页面,我想知道运行之后,给$('div.chapter a[href*=wikipedia]')加的rel,id,title属性在哪里可以看见,我查看源码里也没有。
象这个在哪里可以看见。
<a href="http://en.wikipedia.org/wiki/Pentagon" rel="external"
id="wikilink-0" title="learn more about Pentagons at Wikipedia">
Pentagons
</a>

我是初学jquery,谢谢


...全文
178 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
chen_ya_ping 2010-01-15
  • 打赏
  • 举报
回复
有效果就可以了,你想的是源代码中的东西都是服务器端生成然后传给客户端的,你现在在客户端生成,当然是看不到的。
程程 2010-01-15
  • 打赏
  • 举报
回复
sugercgq 2010-01-15
  • 打赏
  • 举报
回复
故意写错js..用vs调试...
wazdoyang 2010-01-15
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 wazdoyang 的回复:]
引用 11 楼 jenny0810 的回复:
引用 9 楼 wazdoyang 的回复:
調試狀態可以看到啊 你調試
不知道怎么调试 能说说步骤吗???谢谢了

#7 那樣就行啊,
或者你不是IE8 就用 VS調試
[/Quote]

首先你的
IE高级设置去取消禁止调试的2個勾
然後在本頁面JS裏隨便寫一個語法錯誤 我經常用1=2;
然後刷新一下頁面 會彈出錯誤 你 選擇VS 然後 點是 就可以調試了
wazdoyang 2010-01-15
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 jenny0810 的回复:]
引用 9 楼 wazdoyang 的回复:
調試狀態可以看到啊 你調試
不知道怎么调试 能说说步骤吗???谢谢了
[/Quote]
#7 那樣就行啊,
或者你不是IE8 就用 VS調試
jenny0810 2010-01-15
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 wazdoyang 的回复:]
調試狀態可以看到啊 你調試
[/Quote]不知道怎么调试 能说说步骤吗???谢谢了
liubangls 2010-01-15
  • 打赏
  • 举报
回复
查看源代码不能看到,是因为DOM不等于源代码,你看到的效果其实是DOM的表现,JQuery代码操作的是DOM,所以你当然在查看源代码里看不到了。推荐FF下Firebug或IE下的IEDeveloper
wazdoyang 2010-01-15
  • 打赏
  • 举报
回复
調試狀態可以看到啊 你調試
jshi123 2010-01-15
  • 打赏
  • 举报
回复
看动态生成的html:
alert(document.body.innerHTML);
指间的风 2010-01-15
  • 打赏
  • 举报
回复
上边的没打完。
然后点Script,
然后在Star Debuging 后边寻找你的JS位置,然后设置断点,
然后进行点击Star Debuging 开始调试。
jenny0810 2010-01-15
  • 打赏
  • 举报
回复
那就是说IE6和IE7都看不到了,是不是换种写法可以看到呢???
指间的风 2010-01-15
  • 打赏
  • 举报
回复
ie8 然后按 F12
wazdoyang 2010-01-15
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 jenny0810 的回复:]
引用 1 楼 wazdoyang 的回复:
火狐可以看到 IE不行
是查看源码看的吗??我没装火狐,是不是这种写法看不到呀。
[/Quote]
我用火狐一直是裝了 firebug後 點右鍵查看元素看的 比較方便
IE我也看不到
igelf 2010-01-15
  • 打赏
  • 举报
回复
ff中.可以查看选中源代码.
jenny0810 2010-01-15
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 wazdoyang 的回复:]
火狐可以看到 IE不行
[/Quote]是查看源码看的吗??我没装火狐,是不是这种写法看不到呀。
wazdoyang 2010-01-15
  • 打赏
  • 举报
回复
火狐可以看到 IE不行
jenny0810 2010-01-15
  • 打赏
  • 举报
回复
[Quote=引用 17 楼 doulestring 的回复:]
本来就看不到,你要看DOM才行
[/Quote]能具体说一下怎么看吗???谢谢
周睿 2010-01-15
  • 打赏
  • 举报
回复
本来就看不到,你要看DOM才行

62,051

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧