scriptwriters please advise!

  mco 01:18 26 Feb 06
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 06

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

  beynac 11:11 26 Feb 06

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 06

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 06

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 06

many thanks!

  mco 14:18 26 Feb 06

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 06

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 06

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 06

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 06

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.

Sony Xperia XZ Premium review: Hands-on with the new 4K HDR phone with Motion Eye camera and Snapdr5…

1995-2015: How technology has changed the world in 20 years

Best laptop for design and art 2017: we test Apple, Dell, HP, Lenovo and Microsoft's most powerful…

Apple Watch 2 vs Huawei Watch 2 comparison review: watch out for 4G smartwatches Apple