Skip to main content
added 85 characters in body
Source Link

##HTML:


Update :

I was wrong about this one - stackoverflow.com/a/3558200/567864

Even though html is a permissive markup close all the tags - Some browsers may enter quirks mode and it makes the processing harder for the browser.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)" />

Table shouldn't be used for layout, they are hard to maintain and style, use div instead.

Semantically speaking, the table tag is meant for listing tabular data. It is not optimized to build structure.


Maintain the same naming style:

  • Here you did upper case for the tag name: <FORM name="Keypad" action="">

  • Here you capitalize type value : <td><input id="btn1" type="Button" value=" 1 " onclick="NumPressed(1)"></td>

  • Here you used camel case : <td colspan="2"><input id="btnC" type="Button" value=" C "onclick="Clear()"></td>

  • But here you didn't for the id : <input id="btnequals" type="Button" value=" = " onclick="Operation('=')">


Verify it for correctness on http://validator.w3.org/#validate_by_input

##CSS:


Bad syntax :

background-color: #202020 ;n

That n at the end was it intended? doesn't look valid to me.


Your gradient on input[type="button"] looks weird ... same color at the start and at the end with the background on the same color. That is not a gradient at all.


You used the same declaration twice :

input[type="button"]{

Namespace your style - In case you want to add this to a bigger page your style may affect more than you intended.

###JavaScript:


You shouldn't use an empty if with an else just to reverse it.

if (FlagNewNum && PendingOp != "="); 
else
{

Your functions are meaningless if taken apart, you should consider grouping them in an namespace, object or model. Also being global scoped may not go well within a larger page.


Use a standard naming convention : http://en.wikipedia.org/wiki/Naming_convention_%28programming%29 reduce the effort needed to read and understand source code by others and enhances source code appearance.

User Experience:


When it comes to calculators, one can expect to be able to enter values by keyboard as well and not just with the mouse.

##HTML:


Update :

I was wrong about this one - stackoverflow.com/a/3558200/567864

Even though html is a permissive markup close all the tags - Some browsers may enter quirks mode and it makes the processing harder for the browser.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)" />

Table shouldn't be used for layout, they are hard to maintain and style, use div instead.

Semantically speaking, the table tag is meant for listing tabular data. It is not optimized to build structure.


Maintain the same naming style:

  • Here you did upper case for the tag name: <FORM name="Keypad" action="">

  • Here you capitalize type value : <td><input id="btn1" type="Button" value=" 1 " onclick="NumPressed(1)"></td>

  • Here you used camel case : <td colspan="2"><input id="btnC" type="Button" value=" C "onclick="Clear()"></td>

  • But here you didn't for the id : <input id="btnequals" type="Button" value=" = " onclick="Operation('=')">

##CSS:


Bad syntax :

background-color: #202020 ;n

That n at the end was it intended? doesn't look valid to me.


Your gradient on input[type="button"] looks weird ... same color at the start and at the end with the background on the same color. That is not a gradient at all.


You used the same declaration twice :

input[type="button"]{

Namespace your style - In case you want to add this to a bigger page your style may affect more than you intended.

###JavaScript:


You shouldn't use an empty if with an else just to reverse it.

if (FlagNewNum && PendingOp != "="); 
else
{

Your functions are meaningless if taken apart, you should consider grouping them in an namespace, object or model. Also being global scoped may not go well within a larger page.


Use a standard naming convention : http://en.wikipedia.org/wiki/Naming_convention_%28programming%29 reduce the effort needed to read and understand source code by others and enhances source code appearance.

User Experience:


When it comes to calculators, one can expect to be able to enter values by keyboard as well and not just with the mouse.

##HTML:


Update :

I was wrong about this one - stackoverflow.com/a/3558200/567864

Even though html is a permissive markup close all the tags - Some browsers may enter quirks mode and it makes the processing harder for the browser.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)" />

Table shouldn't be used for layout, they are hard to maintain and style, use div instead.

Semantically speaking, the table tag is meant for listing tabular data. It is not optimized to build structure.


Maintain the same naming style:

  • Here you did upper case for the tag name: <FORM name="Keypad" action="">

  • Here you capitalize type value : <td><input id="btn1" type="Button" value=" 1 " onclick="NumPressed(1)"></td>

  • Here you used camel case : <td colspan="2"><input id="btnC" type="Button" value=" C "onclick="Clear()"></td>

  • But here you didn't for the id : <input id="btnequals" type="Button" value=" = " onclick="Operation('=')">


Verify it for correctness on http://validator.w3.org/#validate_by_input

##CSS:


Bad syntax :

background-color: #202020 ;n

That n at the end was it intended? doesn't look valid to me.


Your gradient on input[type="button"] looks weird ... same color at the start and at the end with the background on the same color. That is not a gradient at all.


You used the same declaration twice :

input[type="button"]{

Namespace your style - In case you want to add this to a bigger page your style may affect more than you intended.

###JavaScript:


You shouldn't use an empty if with an else just to reverse it.

if (FlagNewNum && PendingOp != "="); 
else
{

Your functions are meaningless if taken apart, you should consider grouping them in an namespace, object or model. Also being global scoped may not go well within a larger page.


Use a standard naming convention : http://en.wikipedia.org/wiki/Naming_convention_%28programming%29 reduce the effort needed to read and understand source code by others and enhances source code appearance.

User Experience:


When it comes to calculators, one can expect to be able to enter values by keyboard as well and not just with the mouse.

Corrections
Source Link

##HTML:


Update :

Even though html is a permissive markup close all the tagsI was wrong about this one - Some browsers may enter quirks mode and it makes the processing harder for the browserstackoverflow.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :com/a/3558200/567864

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)"/>
Even though html is a permissive markup close all the tags - Some browsers may enter quirks mode and it makes the processing harder for the browser.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)" />

Table shouldn't be used for layout, they are hard to maintain and style, use div instead.

Semantically speaking, the table tag is meant for listing tabular data. It is not optimized to build structure.


Maintain the same naming style:

  • Here you did upper case for the tag name: <FORM name="Keypad" action="">

  • Here you capitalize type value : <td><input id="btn1" type="Button" value=" 1 " onclick="NumPressed(1)"></td>

  • Here you used camel case : <td colspan="2"><input id="btnC" type="Button" value=" C "onclick="Clear()"></td>

  • But here you didn't for the id : <input id="btnequals" type="Button" value=" = " onclick="Operation('=')">

##CSS:


Bad syntax :

background-color: #202020 ;n

That n at the end was it intended? doesn't look valid to me.


Your gradient on input[type="button"] looks weird ... same color at the start and at the end with the background on the same color. That is not a gradient at all.


You used the same declaration twice :

input[type="button"]{

Namespace your style - In case you want to add this to a bigger page your style may affect more than you intended.

###JavaScript:


You shouldn't use an empty if with an else just to reverse it.

if (FlagNewNum && PendingOp != "="); 
else
{

Your functions are meaningless if taken apart, you should consider grouping them in an namespace, object or model. Also being global scoped may not go well within a larger page.


Use a standard naming convention : http://en.wikipedia.org/wiki/Naming_convention_%28programming%29 reduce the effort needed to read and understand source code by others and enhances source code appearance.

User Experience:


When it comes to calculators, one can expect to be able to enter values by keyboard as well and not just with the mouse.

##HTML:


Even though html is a permissive markup close all the tags - Some browsers may enter quirks mode and it makes the processing harder for the browser.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)"/>

Table shouldn't be used for layout, they are hard to maintain and style, use div instead.

Semantically speaking, the table tag is meant for listing tabular data. It is not optimized to build structure.


Maintain the same naming style:

  • Here you did upper case for the tag name: <FORM name="Keypad" action="">

  • Here you capitalize type value : <td><input id="btn1" type="Button" value=" 1 " onclick="NumPressed(1)"></td>

  • Here you used camel case : <td colspan="2"><input id="btnC" type="Button" value=" C "onclick="Clear()"></td>

  • But here you didn't for the id : <input id="btnequals" type="Button" value=" = " onclick="Operation('=')">

##CSS:


Bad syntax :

background-color: #202020 ;n

That n at the end was it intended? doesn't look valid to me.


Your gradient on input[type="button"] looks weird ... same color at the start and at the end with the background on the same color. That is not a gradient at all.


You used the same declaration twice :

input[type="button"]{

Namespace your style - In case you want to add this to a bigger page your style may affect more than you intended.

###JavaScript:


You shouldn't use an empty if with an else just to reverse it.

if (FlagNewNum && PendingOp != "="); 
else
{

Your functions are meaningless if taken apart, you should consider grouping them in an namespace, object or model. Also being global scoped may not go well within a larger page.


Use a standard naming convention : http://en.wikipedia.org/wiki/Naming_convention_%28programming%29 reduce the effort needed to read and understand source code by others and enhances source code appearance.

User Experience:


When it comes to calculators, one can expect to be able to enter values by keyboard as well and not just with the mouse.

##HTML:


Update :

I was wrong about this one - stackoverflow.com/a/3558200/567864

Even though html is a permissive markup close all the tags - Some browsers may enter quirks mode and it makes the processing harder for the browser.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)" />

Table shouldn't be used for layout, they are hard to maintain and style, use div instead.

Semantically speaking, the table tag is meant for listing tabular data. It is not optimized to build structure.


Maintain the same naming style:

  • Here you did upper case for the tag name: <FORM name="Keypad" action="">

  • Here you capitalize type value : <td><input id="btn1" type="Button" value=" 1 " onclick="NumPressed(1)"></td>

  • Here you used camel case : <td colspan="2"><input id="btnC" type="Button" value=" C "onclick="Clear()"></td>

  • But here you didn't for the id : <input id="btnequals" type="Button" value=" = " onclick="Operation('=')">

##CSS:


Bad syntax :

background-color: #202020 ;n

That n at the end was it intended? doesn't look valid to me.


Your gradient on input[type="button"] looks weird ... same color at the start and at the end with the background on the same color. That is not a gradient at all.


You used the same declaration twice :

input[type="button"]{

Namespace your style - In case you want to add this to a bigger page your style may affect more than you intended.

###JavaScript:


You shouldn't use an empty if with an else just to reverse it.

if (FlagNewNum && PendingOp != "="); 
else
{

Your functions are meaningless if taken apart, you should consider grouping them in an namespace, object or model. Also being global scoped may not go well within a larger page.


Use a standard naming convention : http://en.wikipedia.org/wiki/Naming_convention_%28programming%29 reduce the effort needed to read and understand source code by others and enhances source code appearance.

User Experience:


When it comes to calculators, one can expect to be able to enter values by keyboard as well and not just with the mouse.

Source Link

##HTML:


Even though html is a permissive markup close all the tags - Some browsers may enter quirks mode and it makes the processing harder for the browser.

Instead of :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)">

Use :

<input id="btn7" type="Button" value="  7  " onclick="NumPressed(7)"/>

Table shouldn't be used for layout, they are hard to maintain and style, use div instead.

Semantically speaking, the table tag is meant for listing tabular data. It is not optimized to build structure.


Maintain the same naming style:

  • Here you did upper case for the tag name: <FORM name="Keypad" action="">

  • Here you capitalize type value : <td><input id="btn1" type="Button" value=" 1 " onclick="NumPressed(1)"></td>

  • Here you used camel case : <td colspan="2"><input id="btnC" type="Button" value=" C "onclick="Clear()"></td>

  • But here you didn't for the id : <input id="btnequals" type="Button" value=" = " onclick="Operation('=')">

##CSS:


Bad syntax :

background-color: #202020 ;n

That n at the end was it intended? doesn't look valid to me.


Your gradient on input[type="button"] looks weird ... same color at the start and at the end with the background on the same color. That is not a gradient at all.


You used the same declaration twice :

input[type="button"]{

Namespace your style - In case you want to add this to a bigger page your style may affect more than you intended.

###JavaScript:


You shouldn't use an empty if with an else just to reverse it.

if (FlagNewNum && PendingOp != "="); 
else
{

Your functions are meaningless if taken apart, you should consider grouping them in an namespace, object or model. Also being global scoped may not go well within a larger page.


Use a standard naming convention : http://en.wikipedia.org/wiki/Naming_convention_%28programming%29 reduce the effort needed to read and understand source code by others and enhances source code appearance.

User Experience:


When it comes to calculators, one can expect to be able to enter values by keyboard as well and not just with the mouse.