Connecting Tech Pros Worldwide Help | Site Map

Inserting HTML inside a script

  #1  
Old January 24th, 2007, 10:45 PM
Serious_Practitioner
Guest
 
Posts: n/a
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.




  #2  
Old January 24th, 2007, 11:15 PM
VK
Guest
 
Posts: n/a

re: Inserting HTML inside a script


On Jan 25, 1:38 am, "Serious_Practitioner"
<Serious_PractitionerNOS...@att.netwrote:
Quote:
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.
}

Quote:
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

  #3  
Old January 27th, 2007, 03:35 PM
Serious_Practitioner
Guest
 
Posts: n/a

re: Inserting HTML inside a script


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" <schools_ring@yahoo.comwrote in message
news:1169679877.567203.137520@s48g2000cws.googlegr oups.com...
Quote:
On Jan 25, 1:38 am, "Serious_Practitioner"
<Serious_PractitionerNOS...@att.netwrote:
Quote:
>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.
}
>
>
Quote:
>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
>

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting multiple record in MYSQL one at a time sequentially using AJAX javediq143 answers 1 January 6th, 2009 01:35 PM
inserting text into HTML Slain answers 2 May 18th, 2007 10:15 PM
Inserting Page Load Times into HTML Source as a HTML Comment ste-m answers 2 November 1st, 2006 11:35 AM
DBI problem inserting html into mssql db Kristian answers 0 July 19th, 2005 05:48 AM