External java script file | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
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

12th Apr 2017, 12:47 AM
Manoj singh jalal
Manoj singh jalal - avatar
3 Respuestas
+ 2
any examples of your code?
12th Apr 2017, 1:11 AM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
+ 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...
12th Apr 2017, 10:46 PM
Rose Sevenyears
Rose  Sevenyears - avatar
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
12th Apr 2017, 2:18 AM
Manoj singh jalal
Manoj singh jalal - avatar