470,619 Members | 1,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

Inserting HTML inside a script

Hi, and thank you in advance for any assistance.

I would like to use a script to determine if a date meets a condition, and,
if it does, then create a table row with a couple of cells, and then put
some text in the cells. I don't know if that is possible, so that's my first
question. It seems to me that the HTML would have to be in the script, but
I'm not experienced enough to know.

The second question is how might I search for info through a search engine
for this? Any suggestions on terms?
Thank you...
Steve E.


Jan 24 '07 #1
2 2210
VK
On Jan 25, 1:38 am, "Serious_Practitioner"
<Serious_PractitionerNOS...@att.netwrote:
I would like to use a script to determine if a date meets a condition, and,
if it does, then create a table row with a couple of cells, and then put
some text in the cells.
var deadline = new Date(2006,1,1);
// year, month, day where month goes 0-11
// (0 - January, 11 - December)
// day goes in the regular way 1-31
// silly, I know ;-) so just memorize

var now = new Date();
// current date

if ( now.getTime() < deadline.getTime() ) {
// here I'm not sure: if you want to insert the row
// right on page load then use document.write();
// otherwise DOM methods will be needed.
// More info would help.
}

The second question is how might I search for info through a search engine
for this? Any suggestions on terms?
javascript scripting dynamic table insert row DOM

Jan 24 '07 #2
Thank you, VK, for your note. More info -

The information that I want to present this way is about classes or seminars
that will take place on given dates. For each seminar, I'd like to make the
comparison to the date, then, if the date has not passed, build a table with
one row and three (or four) cells; one cell would be the name of the class,
the next cell would be a description, the next cell would be the date and I
forgot what I wanted the fourth cell for. I realize that the date of the
class would have to be in the code for the comparison. And I know it's a
little awkward, because we would need similar code blocks for each class. I
can't take the time now to learn enough about MySQL and PHP to do this using
those tools - that's a few months away. This is a stopgap solution.

Thank you again.
Steve E.

"VK" <sc**********@yahoo.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
On Jan 25, 1:38 am, "Serious_Practitioner"
<Serious_PractitionerNOS...@att.netwrote:
>I would like to use a script to determine if a date meets a condition,
and,
if it does, then create a table row with a couple of cells, and then put
some text in the cells.

var deadline = new Date(2006,1,1);
// year, month, day where month goes 0-11
// (0 - January, 11 - December)
// day goes in the regular way 1-31
// silly, I know ;-) so just memorize

var now = new Date();
// current date

if ( now.getTime() < deadline.getTime() ) {
// here I'm not sure: if you want to insert the row
// right on page load then use document.write();
// otherwise DOM methods will be needed.
// More info would help.
}

>The second question is how might I search for info through a search
engine
for this? Any suggestions on terms?

javascript scripting dynamic table insert row DOM

Jan 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Rainmaker | last post: by
2 posts views Thread by j van c | last post: by
3 posts views Thread by sklett | last post: by
2 posts views Thread by Slain | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.