2009-08-31 35 views
0

helpful idea from Andy Gaskell動態載入站支持我的下一個問題的50%:與WordPress

我想加載信息動態與WordPress。用Andy的函數獲取它們確實有效,但是如何將負載綁定到每個帖子?

我可以將PHP生成的內容(例如帖子永久鏈接)插入到JS腳本中嗎?

謝謝。

回答

1

明白了:

$("#triggerDIV a").click(function(id){ 
    event.preventDefault(); // prevent a element from executing 
    var id = this.getAttribute('href'); // get the link 
    $("#targetDIV").load(id); // load it 
});