Contact Number

+91 908 908 6161

Email Address

info@darlic.com

Sign up
Login

Learn with Darlic®
  • HTML
  • CSS
  • JQuery
  • Javascript
  • PHP
  • SQL
  • Tutorials
  • Courses

src

src

Posted on March 24, 2017 by

Definition and Usage

The src attribute specifies the URL of an external script file.

If you want to run the same JavaScript on several pages in a web site, you should create an external JavaScript file, instead of writing the same script over and over again. Save the script file with a .js extension, and then refer to it using the src attribute in the <script> tag.

This attribute specifies the URI of an external script; this can be used as an alternative to embedding a script directly within a document. If a script element has a src attribute specified, it should not have a script embedded inside its tags.

Attribute Values

Value Description
URL The URL of the external script file.Possible values:

  • An absolute URL – points to another web site (like src=”http://www.example.com/example.js”)
  • A relative URL – points to a file within a web site (like src=”/scripts/example.js”)

 

Post navigation

Previous
Next

Empty Widget Area

About Darlic®

Darlic® is innovative platform to create websites, web applications, progressive web applications, mobile applications without a pain. Darlic® is registered Trademark of OXO IT SOLUTIONS PRIVATE LIMITED.

Links

  • Home
  • About
  • Features
  • Templates
  • Career
  • Blog
  • Contact

Resources

  • Documentation
  • Resources
  • Tools
  • Bits
  • Learn
  • Ask

Email Address

info@darlic.com

Contact Number

+91 908 908 6161

Social Links

Copyright Right
  • Privacy Policy
  • Terms and Condition