由于gulp和js文件的缩小问题,gulp会使文件大3倍。
例如lightgallery.min.js- 49kb(从GitHub下载),然后我通过npm下载相同的文件,并且在js文件中是必需的(如果我插入从github下载的文件内容,则相同)
global.lightgallery = require('lightgallery');
Run Code Online (Sandbox Code Playgroud)
并运行gulp,它使文件133kb
任务任务
gulp.task('scripts', function() {
gulp.src( SOURCEPATHS.jsSource )
.pipe( browserify() )
.pipe( uglify() )
.pipe( rename({ extname: '.min.js' }) )
.pipe( gulp.dest(APPPATH.js) );
});
Run Code Online (Sandbox Code Playgroud)
不使用任何源映射。
也许有人遇到同样的问题?
通过ajax提交信息有问题.
例如有20行.单击行,它将打开有关服务的所有信息.
$('tr').click(function() {
var servicesUpdateId = $(this).attr('data');
$("#"+servicesUpdateId).css({"display":"block", 'opacity':'0'}).animate({left: '0',opacity: '1',});
// save form class for ajax submit
localStorage.setItem("formId", servicesUpdateId);
});
Run Code Online (Sandbox Code Playgroud)
这里的html:
<tbody>
<?php
$allServices = Services::where('user_id', $mainUser->id);
foreach($allServices as $oneServices) {
?>
<tr class="services-table-hover" data="services_<?php echo $oneServices->id; ?>">
<td> <div class="services-color"></div> <img src="/assets/images/provider_img2.png" alt=""> </td>
<td class="title-name"> <?php echo $oneServices->name; ?> </td>
<td> <?php echo $oneServices->description; ?> </td>
<td> <?php echo $oneServices->duration; ?> mins </td>
<td> <?php echo $oneServices->currency; ?> <?php echo $oneServices->price; ?> </td>
<td style="line-height: 50px;"> …Run Code Online (Sandbox Code Playgroud) 文件夹结构:
- assets
- all css / js
- calsses
- all models, db ant etc
- views
- admin
- app
- index.php
- customers.php
.......
Run Code Online (Sandbox Code Playgroud)
我的.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^(www.)?localhost:8080$
RewriteRule ^(.*)$ /views/$1
RewriteRule ^(/)?$ /views/index.php [L]
Run Code Online (Sandbox Code Playgroud)
地址:localhost:8080/app/- 工作正常,但后来我尝试添加漂亮的网址例如我customers.php- localhost:8080/app/customers.php?id=5更改为localhost:8080/app/customers/id/5
htaccess添加了新行:
RewriteRule /id/(.*) customers.php?id=$1
Run Code Online (Sandbox Code Playgroud)
它不工作,它总是返回500内部服务器错误可能有问题?
加上需要没有.php扩展的所有网址