在wordpress中,我有一個頁面設置爲使用jQuery隨機發布,我期待將這個(隨機)頁面的各個部分拉到當前的各個部分(家)此刻頁面的代碼如下:jQuery將各種id加載到頁面的各個部分
$('#wrongQuote').load('random/index.php #wrongSaying' + '?noCache=' + Math.floor(Math.random()*10001)); $('#sayingBy').load('random/index.php #author' + '?noCache=' + Math.floor(Math.random()*10001)); $('#actualQuote').load('random/index.php #actualSaying' + '?noCache=' + Math.floor(Math.random()*10001));
麻煩的是,這是在隨機#wrongSaying,#author和#actualSaying拉......我需要的是得到隨機的,但匹配# wrongSaying/#author/#actualSaying
所以我想我需要的是'random/index.php #wrongSaying'然後把div#x插入div#a,div#f到div#e和如此...
任何想法/幫助將不勝感激!
安迪
你的代碼實際上並沒有發送'noCache'值; *#wrongSaying'(或其他ID)應該*在查詢字符串之後*。 – PleaseStand 2010-11-15 22:23:10
@idealmachine - 在頁面上沒有多個id,所有的好處在於id/classes之間的區別等等 - 感謝noCache上的點我會檢查/修改 – tbwcf 2010-11-15 22:26:39
查詢字符串應該是一個單獨的參數,而不是連接到網址。 – 2010-11-15 22:43:45