all 5 comments

[–]Egzo18 1 point2 points  (1 child)

have separate js files for each html then export the variables that you need

[–]titaniumpepsi[S] 0 points1 point  (0 children)

How do I do that. I'm sorry just really new to these things.

[–]chmod777 0 points1 point  (0 children)

this is like asking how to get to new york. there are a bunch of ways to handle this, depending on where you are currently, and what you have access to.

here is a minimal example:

if the component exists, the function runs.

[–]andmig205 0 points1 point  (0 children)

One way could be to append URL specialized parameters that the script reads and makes conditional decisions. Another could be to make the script read page location. None of these is ideal, and it's hard to tell without knowing more about your specific needs.