patternjavascriptMinor
New web project
Viewed 0 times
projectnewweb
Problem
What do you think of http://websilon.org/? Are there things that can be improved? Is there something missing? See the source of the webpages for code.
```
Websilon - Mathematical Knowledge Base
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"]]}
});
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28191597-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
.menu {
margin: 0;
padding: 0;
}
.menu .content {
width: 98%;
padding: 0;
margin: 1%;
margin-top: 0;
margin-bottom: 0;
}
.menu .content button {
margin-right: 10px;
}
.menu {
display: none;
width: 100%;
height: 50px;
line-height: 50px;
background-color: #333333;
color: #FFFFFF;
font-size: 80%;
}
.menu ul {
display: none;
margin: 0;
padding: 0;
width: 200px;
position: absolute;
left: 0;
top: 50px;
border-top: 0;
font-size: 90%;
z-index: 99999;
background-color: #252525;
}
.menu ul li a:active,
.menu ul li a:hover,
.menu ul li a:link,
.menu ul li a:visited,
.menu ul li {
padding: 0px 20px;
text-decoration: none;
color: #AFAFAF;
}
.menu ul li {
padding: 0;
}
.menu ul li:hover > a {
color: #FFFFFF;
}
.menu ul li:hover {
background-color: #0B5ED9;
}
.menu ul li a {
display: block;
}
.menu > li a:active,
.menu > li a:hover,
.menu > li a:link,
.menu > li a:visited,
.menu > li {
font-size: 120%;
text-decoration: none;
color: #FFFFFF;
}
.menu > li:hover {
background-color: #666666;
}
.menu > li {
position: relative;
float: left;
}
.menu > li > a {
```
Websilon - Mathematical Knowledge Base
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"]]}
});
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28191597-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
.menu {
margin: 0;
padding: 0;
}
.menu .content {
width: 98%;
padding: 0;
margin: 1%;
margin-top: 0;
margin-bottom: 0;
}
.menu .content button {
margin-right: 10px;
}
.menu {
display: none;
width: 100%;
height: 50px;
line-height: 50px;
background-color: #333333;
color: #FFFFFF;
font-size: 80%;
}
.menu ul {
display: none;
margin: 0;
padding: 0;
width: 200px;
position: absolute;
left: 0;
top: 50px;
border-top: 0;
font-size: 90%;
z-index: 99999;
background-color: #252525;
}
.menu ul li a:active,
.menu ul li a:hover,
.menu ul li a:link,
.menu ul li a:visited,
.menu ul li {
padding: 0px 20px;
text-decoration: none;
color: #AFAFAF;
}
.menu ul li {
padding: 0;
}
.menu ul li:hover > a {
color: #FFFFFF;
}
.menu ul li:hover {
background-color: #0B5ED9;
}
.menu ul li a {
display: block;
}
.menu > li a:active,
.menu > li a:hover,
.menu > li a:link,
.menu > li a:visited,
.menu > li {
font-size: 120%;
text-decoration: none;
color: #FFFFFF;
}
.menu > li:hover {
background-color: #666666;
}
.menu > li {
position: relative;
float: left;
}
.menu > li > a {
Solution
Don't mix up html, css and javascript. Put the css and javascript into separate files and externally reference them from the html files, this will:
Don't use `
- clean up your html files
- allow the browser to cache the css and javascript so the files don't have to be re-downloaded for each page visit in your site
Don't use `
elements if you don't want to link something:
Talk
Instead, I'd suggest to link to /talk/, or, if that is not reasonable, use the tag. Links to #` are to use when you want to link to the top of the current page.Code Snippets
<li><a href="#">Talk</a>Context
StackExchange Code Review Q#7587, answer score: 5
Revisions (0)
No revisions yet.