0
External java script file
I create external java script file to sperate my code , but using external file, object , dates object is not working but other function like document.write is working , it this is java script default behavior or I m making any mistake
3 Respuestas
+ 2
any examples of your code?
+ 1
check where you put link to you script.
It should load after elements or objects you're workin' with
(or you can just check if elements loaded/or use defer)
to know what exectly wrong we need the code...
0
i make an object like
var person ={
height: 5.7,
name: "sam",
surname: "decotl"
};
in external javascript file
now i access its property in html file
<script>document.write(person.height);</script>
this code not working and nothing displaying
but when i copy this object in html file its working,
now i want to know this is java script default behavior or i m doing some thing wrong