Hello!
I am really new on js and i have one really important question.
If visual basic and firebug doesn’t show me any error and if code doesn’t work on any browser…so what should i do.
I did a little boring – to read my code again to find a simple syntax errors like – writte() for exemple.
But even that does not give me anything!
Is there any good recomendations how to change it all?
Look at this code and could some help to fix the problem:
<script language=”javascript” type=”text/javascript”>
function Animal() {
this.name = “No Name”;
}
Animal.prototype.setName = function(newName) {
if (typeof newName != “undefined”) {
this.name = newName;
}
else {
document.write(“Please enter a valid name”);
}
}
Animal.prototype.getName = function() {
return this.name;
}
dog.setName(“Spot”);
document.write(dog.setName() + “<br />”);
</script>
Browser gives me out only – Please enter a valid name??