relatedarticle.js
资源名称:dom4jxml.rar [点击查看]
上传用户:andy18
上传日期:2022-05-22
资源大小:83k
文件大小:1k
源码类别:
xml/soap/webservice
开发平台:
Java
- $(document).ready(function() {
- LoadRelatedArticle(CurrentEntryId)
- });
- var Uri_RelatedArticleHandler = "/!handler/RelatedArticleHandler.ashx?jsoncallback=?&{0}";
- var Item_dt = "<dd><span><a onclick="LogClickCount(this,183)" href="{1}" target="_blank">{0}</a></span></dd>";
- function LoadRelatedArticle(articleId) {
- var queryString = "articleId=" + articleId;
- $.getJSON(Uri_RelatedArticleHandler.format(queryString), function(data) {
- if (data == "null") {
- return;
- }
- $.each(data, function(i, item) {
- $(".mutualitys").find("dl").append(Item_dt.format(item.Title, item.Url));
- });
- $(".mutualitys").show();
- LogClickCount(this, 184);
- });
- }
- String.prototype.format = function() {
- var str = this;
- for (var i = 0; i < arguments.length; i++) {
- var re = new RegExp('\{' + (i) + '\}', 'gm');
- str = str.replace(re, arguments[i]);
- }
- return str;
- }