dsqnonh2763 2019-06-02 07:50
浏览 216

从jQuery调用控制器方法

I'm building a website with laravel and need to call an API controller method in jQuery.

I can do this with Ajax but is it possible to achieve without using Ajax or any get, post method.

I'm writing my script in view file under the script tag and want to call the controller method inside the document.ready function.

  • 写回答

1条回答 默认 最新

  • dongyue7796 2019-06-03 11:39
    关注

    You need to pass a http request either with a get or post method to interact with the server or the controller method. Here are some ways you can make http request using javascript and also look here for more details

    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建