林在角7个工作,我的要求是我需要Width,Height和Size (in how much kb or mb)图像,并且还我试着将其转化成blob。
我尝试使用以下代码,但即时通讯未获得确切的输出:
var img_url = "http://snook.ca/files/mootools_83_snookca.png";
var blob = new Blob([img_url]);
let reader = new FileReader;
reader.readAsDataURL(blob); // read file as data url
reader.onload = () => { // when file has loaded
console.log(reader.result)
var img:any = new Image();
img.src = reader.result;
img.onload = () => {
this.uploaded_image_width = img.width; //to get image width
this.uploaded_image_height = img.height; //to get image height
this.uploaded_image_url = reader.result; //to get …Run Code Online (Sandbox Code Playgroud) 我需要删除字符串中逗号后的最后一个单词。
例如,我有如下所示的字符串
var text = "abc, def, gh";
Run Code Online (Sandbox Code Playgroud)
我想删除gh该字符串
我试过如下
var text = "abc, def, gh";
var result = text.split(",");
var get = result.substring(-1, result.length);
alert(get);
Run Code Online (Sandbox Code Playgroud)
但我收到错误
无法读取未定义的属性“split”
请帮我。
我已经从 github 克隆了项目并安装在我的本地系统中,一切正常。
我通过命令创建了控制器,控制器已创建,但是当我尝试使用控制器功能时,错误显示如下。
绑定解析异常
目标 [App\Http\Controllers\SomeController] 不可实例化。在 Container.php 中(第 895 行)
我尝试通过运行以下命令来解决这个问题:
php artisan 缓存:清除
php artisan 清晰编译
作曲家转储自动加载
php artisan 优化
php artisan 配置:清除
但我仍然遇到同样的错误。请帮助我解决这个问题。
我的控制器是:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SomeController extends Controller
{
public function getIndex() {
echo "string";
}
}
Run Code Online (Sandbox Code Playgroud)
AppServiceProvider.php:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
Schema::defaultStringLength(191);
}
/**
* Register …Run Code Online (Sandbox Code Playgroud)