Solution 1 :

i fixed the navbar issue by changing

let about = document.getElementById('aboutme');
about.onclick = function go() {
    $("#loadtarget").load("about.html #loadtarget");
}
let home = document.getElementById('home');
home.onclick = function go() {
    $("#loadtarget").load("index.html #loadtarget");
}

to

let about = document.getElementById('aboutme');
about.onclick = function goAbout() {
    $("#loadtarget").load("about.html #loadtarget");
}
let home = document.getElementById('home');
home.onclick = function goHome() {
    $("#loadtarget").load("index.html #loadtarget");
}

just changed function name and it also got rid of the uncaught syntax error…
however, my scripts dont run properly ( some of my onclick functions ceased to work still, any thoughts?

navbar onclick functions run properly, but i have some JS examples on my site where the user can click a p element in the main element, and it will set innerHTML to something different, showcasing JS tricks, and thats the functions that stopped working

Problem :

im sorry if I phrase/ask this wrong, im new and learning but am in need of help.

i have my main index.html set with jquery mini andm y app.js linked to it. im using

let about = document.getElementById('aboutme');
about.onclick = function go() {
    $("#loadtarget").load("about.html #loadtarget");
}
let home = document.getElementById('home');
home.onclick = function go() {
    $("#loadtarget").load("index.html #loadtarget");
}

in my app.js so that when someone clicks about it loads the about.html #loadtarget element, which works fine when i go from home to about me, however, when going from about me back to home
my nav bar is duplicated, and appears twice… now in my index.html my nav bar is NOT in my load target

<main class="main" id="loadtarget">

and also when debugging in browser i see:

Uncaught SyntaxError: Identifier 'navbar' has already been declared
    at b (jquery-3.5.1.min.js:2)
    at Function.globalEval (jquery-3.5.1.min.js:2)
    at Object.dataFilter (jquery-3.5.1.min.js:2)
    at jquery-3.5.1.min.js:2
    at l (jquery-3.5.1.min.js:2)
    at XMLHttpRequest.<anonymous> (jquery-3.5.1.min.js:2)
    at Object.send (jquery-3.5.1.min.js:2)
    at Function.ajax (jquery-3.5.1.min.js:2)
    at Function.S._evalUrl (jquery-3.5.1.min.js:2)
    at Pe (jquery-3.5.1.min.js:2)

any ideas on how to prevent my navbar from loading twice upon going back to home from about me?
also, i don’t know if this helps: navbar is a nav bar of my own design, not using jquery’s navbar api’s, i had it on my site before i added the jquery-mini file.

as a side note: when going to about me from home, i know my app.js executes because my footer is there and thats an element added by JS to set year and copyright, but some other functions (some of my onclick functions) cease to work, which also puzzles me, any help would be greatly appreciated.

navbar onclick functions run properly, but i have some JS examples on my site where the user can click a p element in the main element, and it will set innerHTML to something different, showcasing JS tricks, and thats the functions that stopped working

again, sorry if im phrasing my question wrong, im still learning.

By