dtbc37573 2014-07-16 14:53
浏览 68

Slim + ajax调用“GET”

im so sorry for my bad english.

I have some problems with slim + ajax

this is my controller

$app->get('/creazioni(/:lim(/:page))', function($lim = 0, $page = 5) use($app){

and this is my ajax code

$.ajax({ //lancio la chiamata principale
type : "GET",
data : "lim=" + lim + "&page=" + pag,
url : 'http://www.urltest.it/creazioni/',
success : function(data) {
    $('#stampa').empty();
    $('#stampa').html(data);
}

console error return a 404 or 509 if i remove / from url:'http://www.urltest.it/creazioni/ it's around 3 days that u try to solve this problem. i making a pagination bu actualy not work xD

Thanks for answer and another time sorry for my english

  • 写回答

1条回答 默认 最新

  • douludi8413 2014-07-16 14:57
    关注

    Looks like your route expects something like

    creazioni/LIM/PAGE
    

    while your GET is sending

    creazioni/?lim=LIM&page=PAGE
    

    One thing you can try is in the jquery, use this for URL:

    'http://www.urltest.it/creazioni/' + lim + '/' + page,
    

    and remove the "data" altogether.

    (Note that I'm not familiar with the framework you use, so this is mostly a guess)

    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line