Problem when including jQuery to HTML

-1

The problem is simple but I do not see any solution, I include my jQuery in my HTML but I do not recognize it.

html

function prueba() {
	alert('alerta');
}
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="es">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div>
	<button id="btn-1" onclick="prueba()">BTN</button>
</div>
<script src="/archivosprocesados.js"></script>
</body>
</html>

my project hierarchy

    
asked by daniel hernandez 23.09.2018 в 19:46
source

1 answer

0

The problem is in the route you put on the line

<script src="/archivosprocesados.js"></script>

since the symbol "/" does not indicate the current directory. Try putting the "." character in front. The line would remain like this:

<script src="./archivosprocesados.js"></script>
    
answered by 23.09.2018 в 23:18