common.js 854 B

12345678910111213141516171819202122232425
  1. function turnPage(url) {
  2. $.ajax({
  3. url: url,
  4. cache: false,
  5. success: function (html) {
  6. $("#content").html(html);
  7. },
  8. error: function () {
  9. $.ajax({
  10. type: "post",
  11. url: url,
  12. cache: false,
  13. dataType: "jsonp",
  14. jsonp: "callback", // 传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(默认为:callback)
  15. jsonpCallback: "success_jsonpCallback", // 自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名
  16. success: function (html) {
  17. $("#content").html(html);
  18. },
  19. error: function () {
  20. alert('fail');
  21. }
  22. });
  23. }
  24. });
  25. }