Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML code within a conditional stmt in JS

Status
Not open for further replies.

gns100

Programmer
Aug 11, 2003
40
US
I want to make a series of links to popup windows active on certain calendar dates.
I know how to get the date part working but need to know how to adjust the HTML code (bold & blue) so that the link becomes live after a certain date. See blue section below.

The HTML version (red) worked OK.

If the date is still in the future I want the link to be present but inactive.

Any help would be appreciated. Thanks.

Code:
<html>
<head>
</head>

<body>
	<SCRIPT LANGUAGE="JavaScript">
	var current_date_julian = 300;
	var jD_0 = 200;
[blue]	    
	if(current_date_julian >= jD_0  ){
		alert("Open Popup Window");
[b]
	// <a href="javascript:;" onclick="MM_openBrWindow('my_file_1.html','','resizable=yes,scrollbars=no,width=390,height=520')">
[/b]
	}
	else{
	
	//alert("Use regular text only - Popup not available");
	}
[/blue]
    </SCRIPT>

[red]
    <!-- Lesson # 1 -->
    <!-- 
    <a href="javascript:;" onclick="MM_openBrWindow('my_file_1.html','','resizable=yes,scrollbars=no,width=390,height=520')">
    -->
[/red]
    <p>Link # 1 </a> 
    &nbsp; Lesson 1</p>

[red]   
    <!-- Lesson # 2 -->
    <a href="javascript:;" onclick="MM_openBrWindow('my_file_2.html','','resizable=yes,scrollbars=no,width=390,height=520')">
[/red]
    
    <p>Link # 2</a>
    &nbsp; Lesson 2</font></p>
</body>
</html>
 
i dont get it, the link itslef must appear only on that date???

Known is handfull, Unknown is worldfull
 
this could be one in javascript but then it would easily be bypassed by changing the sytem date on the clients machine. Server side scripting (PHP, ASP, JSP, etc..) would be a better way of doing this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top