news.js 869 B

1234567891011121314151617181920212223
  1. $(function() {
  2. $.getUrlParam = function (name) {
  3. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  4. var r = window.location.search.substr(1).match(reg);
  5. if (r != null) return unescape(r[2]); return null;
  6. }
  7. var keyid = $.getUrlParam('kid');
  8. var dataUrl = getServerHttp() + '/nx/article/article/'+keyid;
  9. $.ajax({
  10. url: dataUrl,
  11. type: 'post',
  12. cache: false,
  13. dataType: 'json',
  14. success: function (data) {
  15. var data = ajaxDataParames(data);
  16. $('.news-content .content').html(data.contents)
  17. $('.news-content .title').html(data.title);
  18. $('.news-content .info .classify span').html(data.cate);
  19. $('.news-content .info .author span').html(data.name);
  20. $('.news-content .info .date span').html(data.date);
  21. }
  22. })
  23. })