Re: [ js ] 請問這段jquery語法哪裡錯?
Dear yadis,
i'd think that you can use the code such as follows, to have the jquery
take effect as all the document read by browser.
<html>
....
<script language='javascript'>
$(window).ready(init);
function init()
{
$("a[@target*=]").append(" (Opens in New Window)");
}
</script>
....
<body>
...
</body>
</html>
Please check the more detailed info at the official "jquery" site,
referring to "jquery.com".
Samuel
※ 引述《yadis (>"<)》之銘言:
: 小弟最近剛開始摸jquery語法
: 請問以下這段語法哪裡有錯
: <html>
: <head>
: <title>test</title>
: <script>
: $("a[target]").append(" (Opens in New Window)");
: </script>
: </head>
: <body>
: <a href="jsGears" rel="nofollow">http://jsgears.com">jsGears</a>
: <a href="http://google.com" target="_blank">Google</a>
: <a href="http://amazon.com" target="_blank">Amazon</a>
: </body>
: </html>
: 這段程式碼是可以跑
: 可是沒辦法加入jquery的效果
: 請知道的大大幫幫忙
: 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.62.73.57
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章