#Thread

1 messages · Page 1 of 1 (latest)

dry thunder
#

Por que 2 capturas, son 2 html?

#

Tienes un error en la ruta mjs quita m

#

Te falta type="module" en uno de los scripts

midnight gust
#

como quito "m"

dry thunder
midnight gust
dry thunder
#

Fijate en la ruta PassData.mjs deberia ser PassData.js

#

Y pon /js/PassData.js y /js/ReturnData.js

midnight gust
dry thunder
#

Quita el script de PassData solo deja el otro

midnight gust
dry thunder
midnight gust
dry thunder
#

Verdad que estan en la misma carpeta, quita /js

#

'./PassData.js'

midnight gust
dry thunder
#

Subelo a un repo o un codesanbox para mirarlo

midnight gust
dry thunder
dry thunder
#

Me perdi en los archivos jaja, cuantos HTML son y js?

midnight gust
#

3html

#

MAINR y RESGISTROC son donde estoy haciendo eso

dry thunder
#

El archivo REGISTROC no tiene type="module" sobre ReturnData.js

#

Ademas, al usar type=module las funciones no quedan en el scope del window, por lo cual llamar a onclick="returnNewData()" no te funcionara, tendrias que añadirlo en el window: window.returnNewData = returnNewData

midnight gust
#

no entendi bien

dry thunder
#

Tienes un botón donde le pasas onclick="returnNewData()" pero al usar type=module las funciones no quedan en el scope del window, por lo cual la función no existe

#

Tienes 2 alternativas, añadirlas manualmente con window.returnNewData = returnNewData o añadir el evento onclick a través del DOM

midnight gust
#

y como hago eso

dry thunder
#

Pon primero type="module" al script

#

Y sobre el archivo ReturnData.js en la ultima pon window.returnNewData = returnNewData

midnight gust
#

@dry thunder asi?

dry thunder
#

No, dentro del mismo js

midnight gust
dry thunder
midnight gust
dry thunder
#

Tienes que hacer lo mismo en MAinR con las funciones que necesitas en el HTML

midnight gust
#

oka

dry thunder
#

Pero en PassData ya no seria returnNewData sino TravelDAta

midnight gust
dry thunder
#

Si pusiste type="module"?

midnight gust
dry thunder
# midnight gust

Con todo respeto, pero ya te he dicho varias cosas que debes hacer y no las has hecho

#

Añade type="module" en el script de ReturnData y quita los script de PassData

midnight gust
dry thunder
#

Hola @midnight gust pudiste solucionarlo? Si no, manda de nuevos los archivos para verlo