1.

What Is Data-main Attribute?

Answer»

The data-main attribute is an attribute that Require JS will check to start SCRIPT LOADING. The data-main set to the BASE URL for all the scripts.

Example:-

<!DOCTYPE html>

<html>

<head>

<script data-main="libs/main" src="libs/require.js"></script>

</head>

<body>

<H1> RequireJS Sample apps</h1>

</body>

</html>

The data-main attribute is an attribute that Require JS will check to start script loading. The data-main set to the base URL for all the scripts.

Example:-

<!DOCTYPE html>

<html>

<head>

<script data-main="libs/main" src="libs/require.js"></script>

</head>

<body>

<h1> RequireJS Sample apps</h1>

</body>

</html>



Discussion

No Comment Found