Put basically: The javascript is inside your <div class='main'>
So, when the code first loads, it binds an event to your link.
When you click that link… it loads the html into the main div… which includes another binding. So now there’s two of them bound to your link.
You click it again, BOTH of the events fire, reload the main div’s content twice (once each), which binds another 2 bindings to the link…
etc…etc…etc…
Do you mean example.asp? I have no content.asp, just a folder named content.
Do you want me to remove one of the JS links?
I want the this bit:
NOT to be inside the <div class='main'>
.
Isn’t it currently outside the <div class='main'>
?
What does example.asp look like?
I assume that what you’ve got for example.asp is what you called content.asp up in post #6. Which means it includes AjaxJavaScript.asp as part of it. Which is your javascript again.
<!DOCTYPE html>
<!-- #include FILE ="../AJAXJavaScript.asp" -->
<html>
<head>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
</head>
<body>
<h1>Page 1</h1>
</body>
</html>
Yeah. Why is that page loading the javascript again?
sorry about that, I redid it as a working example
I took that out of that page even before I posted originally thinking that myself and it didn’t change the results. So I just removed it and still getting the loop:
example.asp still has the javascript loading for me. Doublecheck you’ve removed it.
Try clearing cache, double check and re-uploaded it, no JS in it.
Your site is 100% still serving an example.asp with the javascript at the top of it.
I just upload this again, what do you see…
<!DOCTYPE html>
<!-- #include FILE ="../AJAXJavaScript.asp" -->
<html>
<head>
</head>
<body>
<h1>Page 1</h1>
</body>
</html>
…
I have literally gotten up, walked to a different computer that has never been to your test page, opened the link in post 36:
I thought you want me to remove the JS, not the AJAX JS…so I can remove the AJAX, what about the jQuery on the example.asp?
Remove ALL of the Javascript from example.asp. All of it. Every last word. No script tags in sight.
Okay, did that and it’s not looping! So tell me on future pages, will I have to add AJAX or JS? Because the pro coder that did that included that on those pages.