草庐IT

laravel-master

全部标签

javascript - laravel pdf文件从ajax请求下载(laravel 5)

我的html代码是这样的:file_path}}');">我的javascript代码是这样的:functionshowAjaxPdf(file_path){varfile_path=file_path.replace(/\\/g,"/");//example:file_path=assets/images/myfile.pdf$.ajax({type:"POST",data:'file_path='+file_path,url:"news/test",success:function(response){$('#test').html(response);}});}我在Control

javascript - Laravel pjax - 设置

我第一次使用pjax和laravel来加快页面加载速度,所以我对此了解不多。我正在使用this包裹。我已经设置好它并且它似乎可以正常工作,但仅对于某些页面,其中我有一些内容的javascript,我有一些问题。这是我的main.js文件:$(document).ready(function(){if($.support.pjax){$.pjax.defaults.timeout=5000;}$(document).pjax('.link',"#pjax");//addclassactivetotabbasedonurlvarloc=window.location.pathname;sw

javascript - Laravel 5 分页 + 无限滚动 jQuery

我正在尝试使用paginate()来实现无限滚动。我认为最简单的方法是使用“无限滚动”来实现这一点。如果您有任何其他建议如何在没有无限滚动库的情况下做到这一点,只需使用jQuery,我很乐意知道..我正在返回变量以像这样查看:publicfunctionindex(){$posts=Post::with('status'=='verified')->paginate(30);returnview('show')->with(compact('posts'));}我的看法:@foreach(array_chunk($posts->all(),3)as$row)@foreach($rowa

laravel 中的 Javascript 函数未定义

我在我的app.js中添加了一个js方法:require('./bootstrap');window.Vue=require('vue');Vue.component('example',require('./components/Example.vue'));constapp=newVue({el:'#app'});functionhello(){alert("hello");}然后编译我的资源并将app.js添加到我的View中:如果此时加载我的View并查看源代码,我可以看到指向app.js的链接,如果我打开该app.js,我可以在其中看到我的hello方法以及许多其他内容。现在

javascript - Laravel 5 扩展 Elixir 以包含 browserify

我的browserify工作流程(从coffee到js,使用browserify-shim和coffeeify)是这样的:我有2个主要文件,app.coffee和_app.coffee,分别用于前端和后端。这两个文件分别位于resources/coffee/front和resources/coffee/back中。我正在尝试在laravelelixir中包含browserify任务,因此结果文件将位于public/js/app.js和public/js/_app.js并且稍后可以修改到build文件夹。到目前为止,我已经尝试通过在elixir的node_modulesingredien

javascript - 如何从 jqgrid 和 Laravel 上传多个文件?

下面是我的代码:letcolNames=['ID','Image','Title','Description'];letcolModel=[{name:'id',index:'id',width:30,editable:true,editoptions:{size:"30",maxlength:"50"}},{name:'image',index:'image',align:'left',editable:true,edittype:'file',editoptions:{multiple:true,accept:".jpg,.png,.jpeg",enctype:"multipart

javascript - 如何: pass data from controller to JavaScript in Laravel 4?

我正在使用Laravel4和jQueryMobile开发一个移动网络应用程序,我在将数据从Controller传递到JavaScript文件时遇到了一些问题。我找到了解决方案,但我认为有一种合适的方法可以做到这一点。这是我的代码:MapController.phpclassMapControllerextendsBaseController{publicfunctionshowMap($id){$club=Club::find($id);returnView::make('pages.map',array('club'=>$club));}}pages/map.phpUploadpic

git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)

项目经理远程创建了一个空项目,无任何内容,给我赋予的developer账号权限,本地改为后提交代码试了很多次都上传不上去,报错如下:![remoterejected]master->master(pre-receivehookdeclined)先说结果:gitpush不上去的原因在于所push的分支权限为protected,只有项目的管理员或具有相应权限的人才能进行push,要进行项目的push,有如下3种方法:1.将所要push的内容所在的分支的protected权限关闭(1)进入所在项目的settings(2)点击进入Protectedbranches,点击unprotected将mast

javascript - 对预检请求的响应未通过访问控制检查 Laravel 和 Ajax 调用

我有一个在远程服务器上托管的Laravel5.1中制作的RESTapi。现在,我尝试从另一个网站(我在本地拥有的网站)使用该API。在Laravel中,我设置了发送CORSheader所需的行。我还使用Postman测试了API,一切似乎都正常!在前端然后,在我使用ajax发送POST请求的网站中,代码如下:varurl="http://xxx.xxx.xxx.xxx/apiLocation";vardata=$("#my-form").serialize();$.ajax({type:"POST",url:url,data:data,headers:{'token':'someAPI

javascript - 我应该在 Laravel 5 中的什么地方存储 JS?

我可以在两个地方存储javascript:resources/assets/javascripts和public/js。如果我们将文件放在resources/assets/javascripts中,我们应该添加gulp任务来复制它们。这是这种方法的弱点。我们将需要在浏览器调试器中进行路径映射。如果我们将这些文件放在public/js中,我们将把源JS和编译后的JS放在一个地方,它们会变得困惑。那么,我应该在Laravel5中的什么地方存储JS? 最佳答案 “Laravel-5”的答案是将它们放在resources/assets/ja