scriptwriters please advise!

  mco 01:18 26 Feb 2006
Locked

I've added some javascript to my site to give the latest update. It's under the globe click here But I want it the same font (which I think is Arial) and bold like the date over on the left. I know bold is b>bold /b> but I don't know in between which brackets to put it and I don't know how to change the font. Help please! The relevant bit's here:
//
// finally display the last modified date
// as DD-MMM-YY
//
document.write(
" updated: " +
date_lastmodified() );

// -->
/script>

Ps - it would be nice if it could be centred under the globe but maybe that's asking too much!

  mco 01:19 26 Feb 2006

I meant <b> with </b> at the end, but still don't know where to put it!

  beynac 11:11 26 Feb 2006

Insert "align='center' into the <TD> tag:

<TD ALIGN="center" COLSPAN=2 ROWSPAN=6 WIDTH=179><IMG ID="Picture5" HEIGHT=175 WIDTH=179 SRC="./assets/images/globefffcc.jpg" BORDER=0 ALT="Geog4U geography globe" TITLE="Geog4U geography globe">

Amend the script to:

document.write(
"<font face='Arial'><b> updated: " +
date_lastmodified() )+"</b></font>";

  beynac 11:23 26 Feb 2006

If you want the font the same size as the other one, add size=-1:

document.write(
"<font face='Arial' size='-1'><b> updated: " +
date_lastmodified() )+"</b></font>";

  beynac 11:34 26 Feb 2006

Sorry, I got the closing bracket in the wrong place. It works - but this is the correct version:

document.write(
"<font face='Arial' size='-1'><b>updated: " +
date_lastmodified() + "</b></font>" );

  mco 12:53 26 Feb 2006

many thanks!

  mco 14:18 26 Feb 2006

I'm sure I've put it in correctly but I get a message -a runtime error has occurred -do you wish to debug? error line 125 unterminated string constant - then it takes me to script editor which I've never seen before and I don't know what to do next!

  mco 14:21 26 Feb 2006

and it's now vanished in preview mode ( I haven't ftp'd it so it's still on as previously online)

  Forum Editor 14:42 26 Feb 2006

a string constant is missing a closing quotation mark. String constants must be enclosed within a pair of quotation marks. You can use matching pairs of single or double quotation marks. Double quotation marks can be contained within strings surrounded by single quotation marks, and single quotation marks can be contained within strings surrounded by double quotation marks.

Does that help?

  beynac 14:45 26 Feb 2006

Did you copy and paste? I don't get any error messages. Try copying this (I've tidied up the spaces a bit to make it clearer);

document.write(
"<font face='Arial' size='-1'><b> updated: "+date_lastmodified()+"</b></font>" );

  mco 14:59 26 Feb 2006

I actually typed it out manually just for the practice, but I've copied and pasted your latest version and it seems to have worked - thanks very much! I'll have a look at the centring now, though I haven't decided if I want it where it is or not. Nice one!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

Alice Saey's mesmerising animation for Dutch singer Mark Lotterman

iPad Pro 10.5in (2017) review

Comment booster votre iPhone ?