Inserting strings directly into text

Hey, all.

I'm wondering how to insert a string that depends on a date/event/etc.
into a sentence. eg:


:
:
la la la, here I go typing again even though I have to go in ?? *** and I still have to have lunch...
:
:


Where ?? is an integer number of mins/hours/etc.
and *** is a string "hours"/"mins"/etc.

Any help would be appreciated.

PS. I could write an applet to do it but for some reason a message akin to:
"Can only create applets for HTML files"
comes up.

I'm about to go to sun.com to look for a new compiler etc. etc. but I would like to know how its done in javascript...

____________________________

Forever trust in who we are,
And nothing else matters.
-Metallica_
____________________________

Comments

  • : Hey, all.
    :
    : I'm wondering how to insert a string that depends on a date/event/etc.
    : into a sentence. eg:
    :
    :
    : :
    : :
    : la la la, here I go typing again even though I have to go in ?? *** and I still have to have lunch...
    : :
    : :
    :
    :
    : Where ?? is an integer number of mins/hours/etc.
    : and *** is a string "hours"/"mins"/etc.
    :
    : Any help would be appreciated.
    :
    : PS. I could write an applet to do it but for some reason a message akin to:
    : "Can only create applets for HTML files"
    : comes up.
    :
    : I'm about to go to sun.com to look for a new compiler etc. etc. but I would like to know how its done in javascript...
    :
    Okay, I think this is what you want...
    [code]

    :
    :

    :
    :

    [/code]
    That should do it.
    [hr]
    [blue]Visual Basic[/blue]
    ~[b]Andy;-)[/b]~[italic]SuperJoe30:-([/italic]~
    My Website:
    http://www.geocties.com/joesarcade :-(
    [red]JavaScript[/red]
    [hr]

  • : Okay, I think this is what you want...
    : [code]
    :
    : :
    : :
    :
    : :
    : :
    :
    : [/code]
    : That should do it.
    : [hr]
    : [blue]Visual Basic[/blue]
    : ~[b]Andy;-)[/b]~[italic]SuperJoe30:-([/italic]~
    : My Website:
    : http://www.geocties.com/joesarcade :-(
    : [red]JavaScript[/red]
    : [hr]
    :
    :

    I tried the document.write() but it opened a new window...
    But maybe I added something else in. I'll try your code it looks
    like it will work. I'll get back to this post if there's a problem.

    Thanks.

    ____________________________

    Forever trust in who we are,
    And nothing else matters.
    -Metallica_
    ____________________________

  • : I tried the document.write() but it opened a new window...

    If you use document.write() because of an event, it erases your web page and makes a new one.

    you have to use it while it's loading.
    [hr]
    [blue]Visual Basic[/blue]
    ~[b]Andy;-)[/b]~[italic]SuperJoe30:-([/italic]~
    My Website:
    http://www.geocties.com/joesarcade :-(
    [red]JavaScript[/red]
    [hr]

  • : If you use document.write() because of an event, it erases your web page and makes a new one.
    :
    : you have to use it while it's loading.
    : [hr]
    : [blue]Visual Basic[/blue]
    : ~[b]Andy;-)[/b]~[italic]SuperJoe30:-([/italic]~
    : My Website:
    : http://www.geocties.com/joesarcade :-(
    : [red]JavaScript[/red]
    : [hr]
    :
    :
    Exellent, Thank you.
    ____________________________

    Forever trust in who we are,
    And nothing else matters.
    -Metallica_
    ____________________________

  • Checl out the span tag... It will make your life a lot easier...

    --------------------------------------------
    I will bend your mind with my spoon...

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories