In many cases, we need to get HTML elements. This post will introduce: How to use JQury to get elements by id, class, tagname, xpath?
How to store and read data using localStorage in Javascript?
We can use localStorage in Javascript to access data. In this post you will learn: ① How to use localStorage? ② How to save and read strings via localStorage? ③ How to store and read Json objects through localStorage?
How to use replace, split and slice methods of strings in Javascript?
In the web applications we develop, processing strings is the most commonly used function, this post will introduce : ① How to replace Javascript strings? ② How to split a string to generate an array? ③ How to slice a string by index?
How to read .txt file by Javascript and keep \r\n effect?
After we open the .txt file in the website, Javascript will automatically ignore the \r\n in the file. This post will cover : ① How to use to select files? ② How to read .txt file using Reader()? ③ How to keep \r\n effect of .txt file?
How to customize the overflow ::webkit-scrollbar?
we need to modify the overflow ::-webkit-scrollbar and ::-webkit-scrollbar-thumb style, make it narrower, modify the color of the ::-webkit-scrollbar-track
How to use javascript to achieve HTML element hover effect?
When we develop website applications, we may need to show or hide some buttons when the mouse hovers over some elements, which is somewhat like the hover effect in css, but since we want changes the exist of elements.
How to figure out Vue axios CORS block?
When we develop website applications, we may use the front-end and back-end separation strategy or request resources from other domain. At this time, we may trigger the http CORS block.
How to load file from URL using PDF.js bypassing browser CORS?
The previous post has introduced how to disable the CORS (Cross-Origin Resource Sharing) of PDF.js, but PDF.js still cannot load the file from the URL, this is because the double CORS block of PDF.js and the browser.
How to use PDF.js to load file from URL and figure out CORS block?
Through the previous steps, we can open local file in PDF.js, but when we want to load file from URL, it will be failed because of blocking the CORS(Cross-Origin Resource Sharing).
How to import and use PDF.js in a new project?
In the previous blog, several pdf webviewer solutions were introduced and compared, including WebViewer and PDF.js. In the end, the open source PDF.js was chosen.