The secret to wholesale...

In the article about buying Thai goods, I introduced wholesale markets and cheap...

Restaurant business and the...

Customers are a special figure in restaurants. This may seem obvious, but...

Guide the clues to...

Japanese goods Known for putting quality first. However, in the past, due...

Online cosmetics business and...

Starting a business, especially online cosmetics business is the silver trend and...
HomeLập trìnhJavaScriptEnlaza JavaScript a...

Enlaza JavaScript a HTML con el Atributo script src


Thuộc tính ‘src’ trong một nghi thức là ruta hacia một kho lưu trữ bên ngoài hoặc định kỳ mà bạn muốn mở một tài liệu HTML.

Ví dụ, nếu bạn tuvieses đề xuất kho lưu trữ cá nhân hóa JavaScript sẽ tạo ‘script.js’ và yêu cầu tổng hợp chức năng của trang HTML, thì hãy tổng hợp các phương pháp sau:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Ejemplo de atributo de script Src</title>
  </head>
  <body>

  <script src="https://www.freecodecamp.org/espanol/news/como-enlazar-a-un-documento-javascript-en-html/./script.js"></script>
  </body>
</html>

Điều này cho phép một tập tin lưu trữ ‘script.js’ mà bạn đang ở trong một thư mục lưu trữ .html sai. También puedes enlazar otros directorios usando ‘..’ en la ruta del archivo.

<script src="https://www.freecodecamp.org/espanol/news/public/js/script.js"></script>

Đây là một nơi mới đến của đạo diễn, trở thành một đạo diễn ‘công khai’, trở thành một đạo diễn ‘js’ và cả một kho lưu trữ ‘script.js’.

También có thể sử dụng thuộc tính ‘src’ để mở tệp lưu trữ “.js” bên ngoài alojados por un tercero. Esto se usa si no quieres descargar una copy local del archive. Solo ten en cuenta que siel enlace cambia or siel access de red está caído, el archive externo que estás enlazando no funcionar.

Đây là một ví dụ về một kho lưu trữ jQuery.

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>

Traducido del artículo Liên kết JavaScript với HTML bằng tập lệnh src Thuộc tính



Zik.vn – Biên dịch & Biên soạn Lại

Đọc thêm  How to maximize revenue, minimize inventory
spot_img

Create a website from scratch

Just drag and drop elements in a page to get started with Newspaper Theme.

Buy Now ⟶

Bài viết liên quang

DMCA.com Protection Status