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

    评论

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样