Domanda

I followed the instructions fr google preffify and all I get is a box with nonthing in it on the page. WHere did I go wrong? I get 200 for the includes.

 <link href="static/js/google-code-prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="static/js/google-code-prettify/prettify.js"></script>


<body onload="prettyPrint()">


        <pre class="prettyprint"><code class="language-html">
            <img src="http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002" /> 
        </code></pre>

        <pre class=prettyprint>
            <img src='http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002' /> 
        </pre>


</body>
È stato utile?

Soluzione

If you're expecting the <img> tags to be prettified, that's not going to work; the browser is going to interpret them.

Try escaping the < etc:

&lt;img src="http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002" /&gt;

edit — however, that tool doesn't appear to have an HTML module.

Altri suggerimenti

escaping the "<" and ">" will make it work

    <pre class="prettyprint"><code class="language-html">
        &lt;img src="http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002" /&gt;
    </code></pre>

    <pre class=prettyprint>
        &lt;img src='http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002' /&gt;
    </pre>

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top