我有从其他网站获取rss的代码
gfeedfetcher.prototype._displayresult=function(feeds){
var rssoutput=(this.itemcontainer=="<li>")? "<ul>\n" : ""
gfeedfetcher._sortarray(feeds, this.sortstring)
for (var i=0; i<feeds.length; i++){
var itemtitle="<a href=\"" + feeds[i].link + "\" target=\"" + this.linktarget + "\" class=\"titlefield\">" + feeds[i].title + "</a>"
var itemlabel=/label/i.test(this.showoptions)? '<span class="labelfield">['+this.feeds[i].ddlabel+']</span>' : " "
var itemdate=gfeedfetcher._formatdate(feeds[i].publishedDate, this.showoptions)
var itemdescription=/description/i.test(this.showoptions)? "<br />"+feeds[i].content : /snippet/i.test(this.showoptions)? "<br />"+feeds[i].contentSnippet : ""
rssoutput+=this.itemcontainer + itemtitle + " " + itemlabel + " " + itemdate + "\n" + itemdescription + this.itemcontainer.replace("<", "</") + "\n\n"
}
rssoutput+=(this.itemcontainer=="<li>")? "</ul>" : ""
this.feedcontainer.innerHTML=rssoutput
}
然后我需要通过javascript
在数据库上插入新的表格和linke答案 0 :(得分:0)
ajax请求的示例:
$.ajax({
type: "POST", // or GET
url: "databasehandler.php",
data: { feedtitle: "Some Title", feedlink: "Some URL" }
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
-
<强> databasehandler.php 强>
<?php
print_r($_POST);
//
// Do your database handles here.
// Connect, Query, then return success/failure status
?>