Issues with Javascript?

FangerZero

New Member
Messages
22
Reaction score
0
Points
1
I'm currently setting up something for my brother, and using my site for tests and what naught so he can see as well. He lives 12 hours away. Anyways I have aa offline test server and the site works perfectly fine there. But when I upload it it doesn't work right. The list you see there should be a drop down menu, as well as have some CSS with it. But it doesn't. I also don't understand I thought that java was client side. It was working fine till I added the Java scripts.

http://fangerzero.elementfx.com/Adam/index.php

EDIT: Found out it's not Javascript but in fact it seems to be my CSS file. any clues?


Navi css
 
Last edited:

gomarc

Member
Messages
516
Reaction score
18
Points
18
Try changing Navigation.css to navigation.css (lowercase).
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
HTML:
<link type="text/css" rel="stylesheet" href="navigation.css" />

should be Navigation.css

Works on Windowz machines, not on *nix machines.

Lucky the page displays at all. The HTML is horrid.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Step 1.
One set of html/head/body tags, nested properly.

HTML:
<html>
<head></head>
<body>

</body>
</html>

Step 2.
title, javascript, css links go in the head section
HTML to display content goes in the body seciton

HTML:
<html>
<head>
<title>Plageman Insurance</title>

<link type="text/css" rel="stylesheet" href="Style.css" />
<link type="text/css" rel="stylesheet" href="navigation.css" />
<script type="text/javascript">
<!--
	function toggle_visibility(id)
		{
		var e = document.getElementById(id);
		if(e.style.display == 'block')
			e.style.display = 'none';
		else
			e.stle.display = 'block';
		}
//-->
</script>


</head>
<body>

HTML for display here

</body>
</html>
 

FangerZero

New Member
Messages
22
Reaction score
0
Points
1
ok well then I don't do as bad as I thought. I threw that in there to test real fast. but thanks for links I guess.
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
It's pretty bad, to be honest. Invalid HTML (the particular errors show a deep misunderstanding of HTML), tables for layout... It needs much work, relative to the size of the file.
 
Last edited:

FangerZero

New Member
Messages
22
Reaction score
0
Points
1
Thanks for trying to help, but I don't learn from lectures. I learn from reading code. And it's not as if you'll have to deal w/ my coding if you don't want to. I'm not a web designer, I'm an Beginner Electrical Engineer/Programmer.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
The problem with learning from code is it's hard to extract the principles behind it, unless you happen to be Alan Kay.

As for dealing with other's code, you're right in that I don't have to deal with it directly, but all our pages live in a larger world. We have to design for the search engines and other programs that access our pages and sites, which creates a lowest-common denominator problem for the programs. A big hurdle in creating a truly semantic web is the pages that don't fit into it. This is an instance of a larger problem, that standards are useless when developers don't follow them.

Remember, a critique of code is not a critique of the code's writer.
 

FangerZero

New Member
Messages
22
Reaction score
0
Points
1
-_- if it's such a big deal to you and you really want me to learn, all you have to do is write ONE page of mine "correctly" and then put a short comment of why. Kind of what that one thing said that you sent about the XML. "No idea what this is because file type wasn't specified at top"

Though no idea why that's important other than maybe making it run a few 1/1000ths of a nanosecond faster. Or preparing the browser for the file type.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
I understand your personal need for sample code to examine, but this isn't an interactive tutorial, or, indeed, any kind of tutorial. It's a forum thread, which is why I linked to the tutorials. And one page of yours probably won't be sufficient, because, for each page, there might be some principles that don't apply to that page. And I'm not obligated to teach you. I offer resources to help you learn on your own.

Though no idea why that's important other than maybe making it run a few 1/1000ths of a nanosecond faster. Or preparing the browser for the file type.
Run-time efficiency is only one of many development concerns.

There's what I already stated, working towards a semantic web, following standards and not miring user agents in the past, requiring them to support outdated HTML usage. Turning this last point around, think how much easier web development would be if we didn't have to support IE 6. For some projects I've worked on, IE 6 has (no exaggeration) doubled the development time.

Then there's Postel's Robustness Principle: "Be conservative in what you do; be liberal in what you accept from others." The page source is your product, so it should be conservative (that is, follow the standards). Tying this in to my earlier point, standards give you well defined behavior on the part of user-agents. Buck the standards, and there's no depending on what user-agents will do with your code. Imagine if there weren't C, C++ or Java standards. You'd have to port your source code if you wanted to change compilers because you couldn't depend on their behavior. As it stands, changing platforms already require you to port code.

What it comes down to is that you should always write to your audience. You don't write web pages for people. People, unless they're developers, don't care about source code. You write web pages for the programs that process them: browsers, spiders, mobile devices, accessibility devices and whatever else people can imagine.

Expanding on the point of "semantic web", remember that programs have no intelligence; they're can't even manage to be stupid. They can't deal with meaning, only structure. Structure can imply meaning, so by creating a well structured document, a program can deal with it as if the program could deal with some meaning. Since programs are your audience, write what they "know": structure.

As for examples of what to do, Descalzo already told you much of what needs to be fixed; the W3C validator will tell you more. The tutorials I linked to tell you even more. I'm not going to repeat the information (laziness: the first great virtue of a programmer. "The quality that makes you go to great effort to reduce overall energy expenditure. [...], and document what you wrote so you don't have to answer so many questions about it.". See also the DRY principle). If you have specific questions about fixing up your code, or something you don't understand, start a thread and you'll get help. Just make sure you explain what you expect and what you actually get, and include a minimal test case.
 
Top