Discussion on:

20
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
Thanks Ryan
lehnerus2000 Updated - 20th Sep
Bookmarked. happy

How does that code account for Leap years?

I notice that you have:
"new Array(31,29, ..." listed in the text description
"new Array(31,28, ..." listed in the actual code.
0 Votes
+ -
Contributr
Simply you just need to modify the array in the leap year as I showed in the text description. However, there are functions to check for leap year which might be able to be incorporated into your code using the function isLeapYear() at the URL http://www.hscripts.com/scripts/JavaScript/isLeapYear.php
I'm just starting js coding.
So far I've managed to get "Hello World" working. grin
I'd really like to know why so many web designers now feel they have to use JavaScript for every damn page they create, even the ones that just provide static information for reading.

Back to the blog subject - I hope you are aware that one of the security settings for top security of your browser is to disable the ability of Java to open a page by itself and to disable the ability for Java to change size, menu, etc. The reason being to stop driveby attacks working in the background with a miniaturised or hidden window.
0 Votes
+ -
I suspect that part of the reason is so that the designer can use variables to control the page or the data on it (like in this article).

I've just finished the intro to HTML5 and CSS part of my course.
It's nightmarishly difficult to do anything that's even slightly tricky with css.

For example, I wanted to make 4 columns of info that auto-sized to the height of the column that contained the most info.
I had to give up and give them all fixed heights.

I suspect that it probably wouldn't be too difficult to accomplish that using js.

I run FF + NoScript. happy
make everything on a web page over fancy. In this I wonder why you want four columns, and if it's really necessary to have four. The next question is why not use frames, even basic html handles frames; I know it's usually difficult to use CSS and frames, but there's nothing says you HAVE to have a CSS at all.

My own website is just stock standard basic html with a couple of frames and a static display of data, as that's all I need. Yes, I know if you have a need to have visitor data input you need to do something a lot more fancy; but only a fraction of the web pages out there need that, so it should be reserved for only when it's needed and not done that way on every page.
0 Votes
+ -
Frames & Tables
lehnerus2000 Updated - 22nd Sep
Every HTML course (I've been on) has taken the position that frames are "evil".
Apparently the "elites" also consider tables to be "evil" these days.

This means that the only option for laying out a page is to use divs (they have to be controlled using css).
I spend almost all of my page creation time debugging divs (e.g. 90% - divs, 10% - everything else).
I suspect that is why so many pages have their layouts controlled by js.

Since the page is part of my course exercises and it must successfully validate as HTML5, all styling must be done in css.
We can choose our own layout structure (it's not necessary for the page to have 4 columns).
If I use 4 columns instead of 2, all of the info (lists of links) will fit on one screen (no scrolling).

I agree that Flash and js are overused on most web pages. happy
Rollover buttons are a good example.
Why use js when it is easy to do it in css?

I also prefer "functional and non-glitzy", to "non-functional and glitzy". happy
CSS and Java that anything that conflicts with them is seen as evil. The current group of teachers are script happy and insist on having scripts for everything.

Not so long back I looked at a web site a friend paid to have created and the four pages had sixty-three scripts between them to display totally static information. There was one script for the banner info, one for the footer info, one for the menu calling the sub-menus and then each of those had their own scripts for their contents. Heck, in one case he had a script calling three scripts that then called two other scripts. The images were resized by the scripts with the original high resolution images being downloaded. The whole lot came to 180 MB of download. I redid it for him as basic html and got it down to 2 MB of download, all set within a three frame page and no CSS as the frames did most of that and one line in the headers of the displayed pages did the rest, I also saved about 100 MB by resizing the images in GIMP to the constrained sizes on the page so the small versions were all that was loaded.

The above was the result of being taught to be script happy with CSS, while I was taught to be plain and basic. Basic takes less download and that's important when the user pays for each MB, like they do here. Also, the smaller the page, the quicker it is to download, important where broadband is not available to everyone, like down here in rural Australia.
0 Votes
+ -
Indeed
lehnerus2000 23rd Sep
The web mail site I use has 100+ scripts running (and Flash ads too)!

Smaller sites are better (less problems and easier to debug/monitor) and as you pointed out, faster to load.
That site must have been appallingly written (css files are tiny).

For example, the basic HTML5 web site assignment I had to complete had:
- 1 css file which was less than 5 KB (200 lines including comments).
- 4 HTML files totalling ~19 KB.
- 29 images totalling ~700 KB.
- 3 video files totalled 71 MB (3 formats were required to support the maximum possible number of browsers).

If it was up to me, I'd use a table for my page layouts.
Not much can go wrong with 4 or 5 cells in a table.
It also bypasses all of the problems that divs cause when you want to use borders.
use browsers that weren't 100% Industry Standard in their operation. However, I'm shocked about the video aspects, last I heard all the browsers handled .avi and .mpg perfectly.

Want a real shock by looking at a site made from extremely basic html code, check out my site at www.bywater.net - all plain stock standard html, but then I'm not trying to deliver anything over fancy. I could add video and sound if I wanted, but most people find them a distraction unless absolutely necessary to the message.
0 Votes
+ -
I should have ...
lehnerus2000 Updated - 23rd Sep
I should have been more specific.

The specifications of the assignment required the use of the HTML5 video tag.
Obviously video files were needed to demonstrate that the code had been correctly implemented.

The 3 videos were required so that Firefox, Chrome, Opera, Maxthon and other HTML5 compliant browsers could play them.

Even with 3 different video formats, IE9 would only play the soundtrack (no video).
because if they were then you would only need the one file that complied with the HTML5 standard. Is the need for three videos due to some of them not being html 5 compliant? If so, which ones do you have to cater to? I'm interested to know which ones aren't being nice.
0 Votes
+ -
The HTML5 Test
lehnerus2000 Updated - 24th Sep
Go to "The HTML5 Test".
Click on the "Other Browsers" tab.

1st - Google Chrome (I don't like it).
2nd - Maxthon (the interface isn't very customisable though).

We basically ignore Internet Explorer (even v10).
We are supposed to check our assignment site with Chrome & FF.
I've also installed Opera and Maxthon.

Some people in my class have Macs, so I guess they check with Safari too.

There are HTML5 tags that aren't supported by any browsers (yet).

Chrome, FF and Opera all support WebM (.webm).

Chrome, FF and Opera all support Ogg (.ogg).
IE and Safari will play Ogg using plugins.

I guess that MP4 (.mp4) is for Apple.
the validity of the "Your Browser" test if they keep the scores. When I first ran it it go down scored in several areas simply because I have those capabilities turned off or plug-ins that disable those capabilities as part of my security settings. Thus the score is in no way relevant to the real capabilities of the browser.

The test said my browser didn't play mpg3 or mpg4, but I play them in the browser all the time - so I don't know how they determine that. However, I do have the system set for it to ask me before playing video, just like a lot of things are set to ask before doing.

Thanks for letting me know about this site.
0 Votes
+ -
No Problems
lehnerus2000 Updated - 24th Sep
"Thanks for letting me know about this site."
No problems. happy

Another site you can look at is "When can I use" (caniuse).
This site has tables for individual elements and properties (HTML, css, js, etc.).
0 Votes
+ -
Moderator
That quite a lot of Web Pages are now accessed by Mobile Devices not "Real Computers" with Mobile Data Plans which are exorbitantly expensive to use, so it makes much more sense to follow the KISS Principal. Keep It Simple Stupid

I can not help but wonder just how many users get peeved off with massive Page Downloads which are expensive to them and how many stop using those sites as a direct result of all the crap included.

But then again I was always taught to be economical with anything I did and just because you have the capacity didn't mean you needed to use it all. wink

Col
a lot of the design concepts are coming out of the USA where most of the people currently have unlimited download Internet plans - that's why there's a big discussion going on over there about paying for downloads by the usage for the phone plans.

In short, the way computers and the Internet are used in the USA is often very different to how the rest of the world use them, and that leads to significant mismatches. One of which is the big US push for using the Cloud for you office and data storage services, that concept is not that bad when you have an unlimited data plan, but when you pay by the megabyte (like we do in Australia) it adds a huge expense to the project.
0 Votes
+ -
"One of which is the big US push for using the Cloud for you office and data storage services, that concept is not that bad when you have an unlimited data plan, ..."

You also need Unlimited Bandwidth.

I forsee the entire Internet collapsing, when millions of people all try to edit 1+ GB of video on "Cloud" servers.
-1 Votes
+ -
Deleted
lehnerus2000 Updated - 24th Sep
Deleted.
Wrong place. sad
I'm curious why the 2nd input button is written using JS? At least in my browser (Chrome), the print button works just as well without having to be written by JavaScript.
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.