To become really one PROFESSIONAL in the development area, you need to understand how a particular technology works. In your case you need to understand how the structure works DOM
of HTML
!
What is a GIFT?
The Document Object Template(DOM
) is a programming interface for documents HTML
, XML
and SVG
. It provides a structured representation of the document as a tree. The DOM
defines methods that allow access to the tree, so that they can change the structure, style and content of the document. The DOM
provides a representation of the document as a structured group of nodes and objects, possessing various properties and methods. Nodes may also have event handlers inherent to them, and once an event is triggered, event handlers are executed. Essentially, it connects web pages to scripts or programming languages. Although the DOM
is frequently accessed using JavaScript
, is not a part of language JavaScript
. It can also be accessed by other languages.
Graphic Example:
Knowing this, briefly in which the browser will "read" the structure HTML
row by row (top to bottom). Adding the answer from @Theo your error is in the following:
<script src="../js/avaliacao.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
Note that you entered your file .js
first and afterward the jquery
, then the browser will "read" and "load" the file first .js
, this will result in the error which you are struggling with. To get around this is quite simple, just change the order of <script>
for:
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
<script src="../js/avaliacao.js"></script>