Re: [問題] 請懂 javascript和 css的高手幫忙

看板Ajax作者時間16年前 (2008/12/24 12:41), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/3 (看更多)
請問我這樣打對嗎 <head> <script src='http://code.jquery.com/jquery-latest.js' type='text/javascript'> function setPost(authorname){ var authorname; if(authorname=="XXXX"){ $('post').addClass(".post_XXXX"); } } </script> .. .. <style type="text/css"> .post{backgroud-color: #FF0000;} .post{........} </style> </head> <body> .... <script> setPost('<data:post.author/>') </script> ..... <body> 請問哪裡有問題? 我試過都不要if, 也不要function 只做 $('.post').addClass....這一行 結果也沒反應阿? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.193.36.137 ※ 編輯: zzbear 來自: 123.193.36.137 (12/24 13:12)

12/28 04:07, , 1F
沒仔細看, 不過addClass的參數不用再加 .
12/28 04:07, 1F
文章代碼(AID): #19KRs2IH (Ajax)
文章代碼(AID): #19KRs2IH (Ajax)