0

I am using jquery ajax to simply load my website/PWA content into a div. The problem is the webpage inside of the div content is a social network and it has multiple links inside that are clickable and when clicked the window opens the links, breaking my customized header and footer. Is there a way to contain all the links clicked inside of the div contained to the div itself. Something similar to an iFrame. If that makes any sense. Does it help if the social network is a headless wordpress?

$('IdOfButton').click ( function () {
     $('content').load ('/signinup.php') ; 
} );
cynclabs
  • 23
  • 3
  • Just apply [something like this](https://stackoverflow.com/questions/12299227/prevent-href-from-opening-link-but-still-execute-other-bind-events) using your div's ID as part of the selector. – isherwood Dec 17 '19 at 18:02

1 Answers1

0

You're missing id or class selector in both of your selectors

JQuery selector can be class selector $('.class') or id $('#id') if you put no selector, like $('content') it will search for <content> elements

Webvoid
  • 501
  • 2
  • 7
  • this is correct but how does this keep the links from opening and breaking my header and footer? – cynclabs Dec 17 '19 at 18:18
  • you can't, but I think what you are looking for are iframe containers. In fact, $.load() puts html directly into your element. so when you click a link, it acts in the main window and so does break your other elements. – Webvoid Dec 17 '19 at 18:24