xgqfrms / FEIQA

FEIQA: Front End Interviews Question & Answers
https://feiqa.xgqfrms.xyz
MIT License
7 stars 0 forks source link

localStorage #9

Open xgqfrms opened 6 years ago

xgqfrms commented 6 years ago

localStorage


localStorage.setItem(`depend_pro_names`, DependencesProjects);
localStorage.setItem(`depend_server_names`, DependencesServers);

let DependencesProjects = localStorage.getItem(`depend_pro_names`).split(","),
    DependencesServers = localStorage.getItem(`depend_server_names`).split(",");
xgqfrms commented 6 years ago

front end how show format xml file in js ?

XML 标签必须严格的使用标签闭合。


<?xml version="1.0" encoding="utf-8" ?>
<BookList>
    <Book>
        <Title>jQuery: Novice to Ninja</Title>
        <Publisher>Site point</Publisher>
    </Book>
    <Book>
        <Title>Learning jQuery</Title>
        <Publisher>PACKT</Publisher>
    </Book>
    <Book>
        <Title>Head First jQuery</Title>
        <Publisher>O'Reilly</Publisher>
    </Book>
    <Book>
        <Title>jQuery UI 1.8</Title>
        <Publisher>PACKT</Publisher>
    </Book>
</BookList>

XMLSerializer()

https://stackoverflow.com/questions/349250/how-to-display-xml-in-javascript


const xml_serializer = new XMLSerializer();

http://www.jquerybyexample.net/2012/04/read-and-process-xml-using-jquery-ajax.html

http://www.peachpit.com/articles/article.aspx?p=29307&seqNum=4

CSS & XML

https://www.w3schools.com/xml/cd_catalog_with_css.xml

https://www.w3schools.com/xml/xml_display.asp

xgqfrms commented 6 years ago

pre & XML & format & heiglight


<!DOCTYPE html>
<html lang="zh-Hans">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>pre & XML & format & heiglight</title>
    <style>
        [data-pre="xml"],
        [data-div="xml"] {
            border: 1px solid red;
            width: 400px;
            height: 300px;
        }

        title {
            color: #000;
            display: block;
        }
    </style>
</head>

<body>
    <section>
        <h1>pre & XML & format & heiglight</h1>
        <pre data-pre="xml"></pre>
        <div data-div="xml"></div>
        <iframe src="./book.xml" frameborder="1"></iframe>
    </section>
    <script>
        const xmlString = `
            <?xml version="1.0" encoding="utf-8" ?>
            <BookList>
                <Book>
                    <Title>jQuery: Novice to Ninja</Title>
                    <Publisher>Site point</Publisher>
                </Book>
                <Book>
                    <Title>Learning jQuery</Title>
                    <Publisher>PACKT</Publisher>
                </Book>
                <Book>
                    <Title>Head First jQuery</Title>
                    <Publisher>O'Reilly</Publisher>
                </Book>
                <Book>
                    <Title>jQuery UI 1.8</Title>
                    <Publisher>PACKT</Publisher>
                </Book>
            </BookList>
        `;
        // const xmlString = `<?xml version="1.0" encoding="utf-8" ?> <BookList> <Book> <Title>jQuery: Novice to Ninja</Title> <Publisher>Site point</Publisher> </Book> <Book> <Title>Learning jQuery</Title> <Publisher>PACKT</Publisher> </Book> <Book> <Title>Head First jQuery</Title> <Publisher>O'Reilly</Publisher> </Book> <Book> <Title>jQuery UI 1.8</Title> <Publisher>PACKT</Publisher> </Book> </BookList>`;
        let preBox = document.querySelector(`[data-pre="xml"]`);
        let divBox = document.querySelector(`[data-div="xml"]`);
        //
        let newXxmlString = xmlString.replace(/</ig, "&lt;").replace(/>/ig, "&gt;<br>");
        preBox.insertAdjacentHTML(`beforeend`, newXxmlString);
        divBox.insertAdjacentHTML(`beforeend`, newXxmlString);
        // preBox.insertAdjacentHTML(`beforeend`, xmlString);
        // divBox.insertAdjacentHTML(`beforeend`, xmlString);
    </script>
</body>

</html>

book.xml


<?xml version="1.0" encoding="utf-8" ?>
<BookList>
    <Book>
        <Title>jQuery: Novice to Ninja</Title>
        <Publisher>Site point</Publisher>
    </Book>
    <Book>
        <Title>Learning jQuery</Title>
        <Publisher>PACKT</Publisher>
    </Book>
    <Book>
        <Title>Head First jQuery</Title>
        <Publisher>O'Reilly</Publisher>
    </Book>
    <Book>
        <Title>jQuery UI 1.8</Title>
        <Publisher>PACKT</Publisher>
    </Book>
</BookList>
xgqfrms commented 6 years ago

Syntax highlighting

https://highlightjs.org/

https://stackoverflow.com/questions/160694/syntax-highlighting-code-with-javascript

https://en.wikipedia.org/wiki/Syntax_highlighting

https://codehighlight.com/

https://chrome.google.com/webstore/detail/codehighlight/gioojphhkmhanbjankdapnegcodlellc

http://prismjs.com/


https://github.com/google/code-prettify

https://craig.is/making/rainbows

https://gohugo.io/content-management/syntax-highlighting/

xgqfrms commented 6 years ago

click & clean

chrome://extensions

chrome://extensions/?id=ghgabhipcejejjmhhchfonmamedcbeod

.crx

https://www.hotcleaner.com/clickclean_chrome.html

https://chrome.google.com/webstore/detail/ghgabhipcejejjmhhchfonmamedcbeod


https://www32.zippyshare.com/v/4YpRIFdi/file.html

https://www.crx4chrome.com/crx/756/

https://clients2.googleusercontent.com/crx/blobs/QgAAAC6zw0qH2DJtnXe8Z7rUJP2uE0bBbl8mvUEPILmjOqrM5rUw9uavNW1PnEpUWy6_OvAs3hmmcXsIt_K3usgy30IntWQKgl1vI0sKdzfxz-ABAMZSmuVM3mzIJKXRceOXbjszDA9ZkR1Kqg/extension_9_1_0_0.crx