Knowledge can be passed by class...

Source: Internet
Author: User

On the New Year's Day holiday, I took a rest. The homepage of the edition requires 10 thousand million RMB. I plan to make it a perpetual calendar that shows the birthday of my friends. Of course, there is no doubt about code modification. Fortunately, I used to learn how to create web pages in college and understand the HTML language. When Dreamweaver was not popular, I used notepad to write the HTML language. However, I didn't know much about JavaScript. At that time, I learned VBScript. These are all self-taught.

In order to achieve this function, I tried to read JavaScript. Each function is researched by each function. Google's use has been mentioned, including JavaScript syntax and scripts. They are all from Google. I wrote several functions in the same way, but I did not implement them. I almost gave up halfway. However, I went to learn, read, and imitate it with patience. For two consecutive days, it seems that the University has been gaining momentum since half past one AM. I remember that when I was in school, I had no computer. I went to the internet cafe for the purpose of making webpages.

Hard work. After two days of research, I finally imitated and wrote a function to implement the functions I needed. Of course, it is not worth mentioning for insiders. However, for me who have no foundation, it's just a little excited to chew on the code for a few hours and then implement the functions I want.

There is a question: is there anything similar to single-step debugging in the production of web pages. Or this debugging is too hard. No variables are visible, no execution steps are visible, and it takes only time to try. The current website creation technology does not know the level of development.

Technology is the same. Whether it's embedded technology or web technology. Their essence and thoughts are consistent. The concept may be different, but the focus is different.

 

Some Perpetual calendar codes are as follows:

Function showbirth (){
VaR SD, S, size;
CLD = New Calendar (TY, Tm );
{

Sobj = eval ('bid ');

Sobj. classname = '';

SD = tD-1;

If (SD>-1 & SD <ClD. Length) {// within the date
// Sobj. innerhtml = sd + 1;

If (CLD [SD]. istoday) sobj. classname = 'blue'; // Today's color

Sobj. style. Color = CLD [SD]. color; // national holiday color

S = CLD [SD]. lunarfestival;
If (S. length> 0) {// lunar calendar day
If (S. length> 6) S = s;
S = S. fontcolor ('red ');
}
Else {// calendar Festival
S = CLD [SD]. solarfestival;
If (S. length> 0 ){
Size = (S. charcodeat (0)> 0 & S. charcodeat (0) <128 )? 8: 4;
If (S. length> size + 2) S = s;
S = S. fontcolor ('red ');
}
Else {// four nodes
S = CLD [SD]. solarterms;
If (S. length> 0) S = S. fontcolor ('red ');
}
}
If (S. length> 0)
{
S = 'Today is <B> '+ S +' </B> ';
Sobj. innerhtml = s;
}

}
Else {// non-date
Sobj. innerhtml = '';
}
}
}

You only need to add this function to the initialization function.

 

Function initial ()...{
Dstyle = detail. style;
ClD. Sy. selectedindex = tY-1900;
ClD. Sm. selectedindex = TM;
Drawcld (TY, Tm );
Showbirth ();

ClD. tz. selectedindex = getcookie ("TZ ");
Changetz ();
Tick ();
}

Then add <font id = "Bid" color = # ff6633 size = 3> </font> to the table to display the birthday.

Interesting ~~~~~~~~~~~~~

However, experts are also recommended to keep a taste of morality ......

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.