javascript – Show another page in a modal popup

I’m working on a page that will have a couple links on it that need to show another page in a modal popup.

I’ve used class="use-ajax" to accomplish this in the past. However, I’m making modifications to this page via JS and these links will not load with that class.

I’ve used the following which opens the page in a modal as expected:

var $myDialog = $('<iframe src=""></iframe>').appendTo('body');
  Drupal.dialog($myDialog, {
    title: 'Title',
    buttons: ({
      text: 'Close',
      click: function() {

However, this renders the entire page. How can I load just the content area of this page similar to how class="use-ajax" data-dialog-options="..." data-dialog-type="..." work?

Thank you!