Php errors on apostrophy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • russgri

    #1

    Php errors on apostrophy

    On a templated site I have:
    header.php with Variables for title, meta, stylesheets for CSS, stylesheets for Javascript.
    The stylesheet called switchmenu.js has some apostrophies in it which caused errors that caused failures.
    I have backslashed the apostrophies below:
    if (document.getElementById){ //DynamicDrive.com change
    document.write(\'<style type="text/css">\n\')
    document.write(\'.submenu{display: none;}\n\')
    document.write(\'</style>\n\')
    }
    Yes,
    I have different title, keywords, stylesheets, for different folders.
    I have backslashed the apostrophies but I still get an error on a line that is past the </html>.
    Is the closing html tag supposed to be closed also...
    </html \> or
    </html>\
    You are dealing with a Newbie here
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #2
    It looks like you slashed out the wrong apostrophes

    Try this:
    if (document.getElementById){ //DynamicDrive.com change
    document.write('<style type=\"text/css\">\n')
    document.write('.submenu{display: none;}\n')
    document.write('</style>\n')
    }
    I believe that should work.

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    Working...