简体   繁体   English

Laravel 4 Javascript代码不起作用

[英]Laravel 4 Javascript Code Not Working

I'm using Laravel 4. I included a professional html template into laravel, and going to write a script for it but I've a problem which I am facing for the first time. 我正在使用Laravel4。我在laravel中包含了一个专业的html模板,并打算为其编写脚本,但是我遇到的是我第一次遇到的问题。 I'm including .js , .css with assets but there is a JS code in the template, on mainpage .. And It is not working with laravel. 我包括.js.css与资产,但没有在模板中的JS代码,在mainpage ..它不与laravel工作。 Except that all functions are working fine, but it is not working. 除了所有功能都可以正常工作外,其他所有功能都无法正常工作。

<script type="text/javascript">
jQuery(document).ready(function($){
    /* initiate the plugin */
    $("div.holder").jPages({
        containerID  : "itemContainer",
        perPage      : 3,
        startPage    : 1,
        startRange   : 1,
        links          : "blank"
    });
});     
</script>

PS: I checked, jquery library included into project. PS:我检查过,项目中包含了jquery库。

Are you sure that files (js) are pproperly loaded? 您确定文件(js)已正确加载吗?

Try add "/" on start every link to assets (js, css...). 尝试在每个指向资产(js,css ...)的链接上添加“ /”。

<link href="assets/css/my.css.... 

to

<link href="/assets/css/my.css...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM