登录 | 注册 | FAQ
Anonymous

Lesson 17

+ 发表回复

5 篇帖子 分页: 1 / 1


Lesson 17

Egemen » 周四 7月 02, 2015 5:29 pm

hi,
i didn't understand how to use "js" file as source.
i opened new nptepad file, write an article and save file as myscript.js and open new notepad file and save as page17.htm and write

<script src="myscript.js"/>

this code. but nothing hapens. if i want re-use a script what should i do?

am i understand it wrong?

ty.
头像

Egemen

  • 帖子: 2
  • 注册: 周一 6月 29, 2015 8:13 pm

Re: Lesson 17

situnrocks » 周四 7月 02, 2015 8:58 pm

I think this way :

<script type='text/javascript' src='PATH-TO-SCRIPT'></script>
头像

situnrocks

  • 帖子: 4
  • 注册: 周四 7月 02, 2015 8:42 pm
  • 地址: Cuttack,India
--
Stay updated with Wallet offers for Recharge / Shop.

Re: Lesson 17

Egemen » 周五 7月 03, 2015 12:57 pm

nope. i couldn't do that. i think i do smt wrong... ty for your help.
头像

Egemen

  • 帖子: 2
  • 注册: 周一 6月 29, 2015 8:13 pm

Re: Lesson 17

James.stier38 » 周六 11月 19, 2016 7:17 am

Use this

<script type='text/javascript' language='javascript' src='Path to your external js file'/>

and after loading the same you may use the external file before calling.

document.getElementById('users').addEventListener('change', showUser, false);

Get the Complete informationPaytm Coupons
头像

James.stier38

  • 帖子: 2
  • 注册: 周六 11月 19, 2016 7:06 am

Re: Lesson 17

Farhin Qureshi » 周四 1月 12, 2017 11:56 am

I think you need to check the path of the Javascript file.It should be in the same folder where your html file resides.
头像

Farhin Qureshi

  • 帖子: 45
  • 注册: 周二 1月 03, 2017 11:33 am
--
Farhin Qureshi
.NET Developer
http://www.ifourtechnolab.com


+ 发表回复

分页: 1 / 1