alfie: Textbereich von Suchmaschinenindizierung ausschließen

Beitrag lesen

Hallo Gunnar!

Ich habe mich für meine Variante 2 entschieden und bin offensichtlich vernagelt (Bürotemperatur 31 °C)

In PHP hole ich mir das Zitat aus der Datenbank und formatiere schon dort den String inlusiver aller möglichen HTML-Tags (manche haben ein title-Attribut, manche einen Link zur Quelle, etc.). Diesen String schreibe ich in den header der HTML Date, sieht zB so aus:

    <script type="text/javascript">  
      //<![CDATA[  
        QuoteOfTheDay = <strong>A scientist in his laboratory is not a mere technician:<br />he is also a child confronting natural phenomena that impress him<br />as though they were fairy tales.</strong> &nbsp; &nbsp;<em><span title='Eve Curie Labouisse, Madame Curie: A Biography (p341, 1937)'><a href='http://en.wikipedia.org/wiki/Marie_Curie'>Marie Curie</a></span></em>  
      //]]>  
    </script>

Im body an entsprechender Stelle dann:
      <script type="text/javascript">
        //<![CDATA[
          document.write("QuoteOfTheDay");
        //]]>
      </script>

Ausgegeben wird:
<span id="quote">QuoteOfTheDay = <strong>A scientist in his laboratory is not a mere technician:<br />he is also a child confronting natural phenomena that impress him<br />as though they were fairy tales.</strong> &nbsp; &nbsp;<em><span title='Eve Curie Labouisse, Madame Curie: A Biography (p341, 1937)'><a href='http://en.wikipedia.org/wiki/Marie_Curie'>Marie Curie</a></span></em></span>

Wieso wird hier der Variablenname + Zuweisung (QuoteOfTheDay = ) am Anfang mit ausgegeben?

Live long and Prosper!
Alfie