1

trying to use cropper.js:

https://github.com/fengyuanchen/cropperjs
https://fengyuanchen.github.io/cropperjs/

After downloading and unpacking files I created index.php on the root level:

<!doctype html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>IMGED</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link href="src/index.css" rel="stylesheet">
</head>

<body>
<div>
  <img id="image" src="img.jpg" alt='img'>
</div>
<script src="src/index.js"></script>

</body>
</html>

Console:

Uncaught SyntaxError: Unexpected identifier... index.js:1  

index.js

import Cropper from './js/cropper';
export default Cropper;

What is wrong, pls?

qadenza
  • 9,025
  • 18
  • 73
  • 126
  • In reading [a similar question](https://stackoverflow.com/questions/47632562/es6-module-import-giving-uncaught-syntaxerror-unexpected-identifier), perhaps try adding `type="module"` to your ` – Tyler Roper Apr 20 '19 at 02:55
  • @TylerRoper, tried and getting this - `http://localhost/imgedit/02/src/js/cropper net::ERR_ABORTED 404 (Not Found)` – qadenza Apr 20 '19 at 03:00

0 Answers0