Best way to hide inline CSS and JavaScript from level browsers

What is the best way to hide inline Javascript and CSS from downstream browsers? ... I see several options for a common theme. Are they all correct or is one approach better than the other?

<script language="javascript" type="text/javascript">
<!--
    // Forces the treeview to adjust to the new size of its container
    function resizeTree(DomElementId, NewPaneHeight, NewPaneWidth) {
        //do stuff
    }

  //-->
</script>

against

<script type="text/javascript">
//<![CDATA[
    /* Javascript code here */
//]]>
</script>

against

  <style type="text/css">
/*<![CDATA[*/     CSS stuff here       /*]]>*/    </style>
+3
source share
1 answer

- pre-HTML 3.2 script , . . ( IE 6 ) , . , language script .

CDATA-, , script . XHTML ( ). , , , , . Wikipedia:

(<) (&) - , , CDATA ofline <script> <style> XHTML. HTML-, CDATA, CDATA

, . Javascript, - CSS.

. CDATA: script HTML.

+3

Source: https://habr.com/ru/post/1757584/


All Articles