</script> rather than in an external script file (
If so, the problem is most likely the closing tags you have in your strings.
In HTML (which includes pretend-XHTML) the
script element type has a content model of
CDATA, which behaves a bit oddly. One oddity is that the first occurrance of the character sequence '
</' followed by a name-start character will be interpreted as
</script> and thereby close the script tag.
To prevent this you need to escape that character sequence, which you can do by inserting a backslash character between the '<' and the '/'. That 'escapes' the '/' character.
homepage += "<li><a href='index.cfm?area=marketplace/index&page=view-forum&forumid=267'>Kingsize bed frame<\\/a><\\/li>"
Without the backslash characters in the end tags, the script tag is closed after 'bed frame' which means the string constant isn't properly terminated.