View Single Post
  #6  
Old 09-06-2014, 07:22 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 22,429
IntoRain is on a distinguished road
Default

See the change of color? The " is closing the comment here:

$document->add(new Comment("<script language=" <-- this closed it

Inside comments, try to use '' instead of quotation marks, try this:

PHP Code:
$document->add(new Comment("<script language='JavaScript'>
// ==============================================
// Copyright 2004 by CodeLifter.com
// Free for all; but please leave in this header.
// ==============================================

var Quotation=new Array() // do not change this!

// Set up the quotations to be shown, below.
// To add more quotations, continue with the
// pattern, adding to the array.  Remember
// to increment the Quotation[x] index!

Quotation[0] = 'Quote 1';

// ======================================
// Do not change anything below this line
// ======================================
var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(Quotation[whichQuotation]);}
showQuotation();</script>"
)); 
Also, I'm not sure if document.write will write the sentence in the right place. If it doesn't, you will have to add an element with Comment() (like $document->add(new Comment("<p class='quote'></p>")) or something) and then in the javascript fill the element with what you want
__________________


asp.net stole my soul.
Reply With Quote