javascript - Trying to use mark.js ES5 and ES6 version without JQuery, but it doesn't work -


i need pure javascript plugin works ie 9+ highlight given regex expression. found mark.js , managed make work, not file recommended in docs inside /dist/ folder.

i've tried both 8.9.1 , 8.10.0 versions. download here

how worked

1 - added javascript library in header tag. note file inside src folder, not recommended in docs.

<script type="text/javascript" src="src/mark.js" charset="utf-8"></script> 

2 - so, in chrome developer tools console i've typed:

new mark(document.queryselector("#div")); 

that works , give me output:

mark {ctx: null, ie: false} 

how didn't work

1 - added javascript library in header tag. note file inside dist folder, said in docs. i've tried both "mark.es6.js" , "mark.js", want working es5 version.

<script type="text/javascript" src="dist/mark.js" charset="utf-8"></script> 

2 - so, in chrome developer tools console i've typed:

new mark(document.queryselector("#div")); 

this didn't work , give me output:

uncaught referenceerror: mark not defined @ <anonymous>:1:1 


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -