0

So I am working on a website trying to use jquery/ajax to load content into the home page. Current test site is [http://newconstructionflorida.net] the home & about me page work without any issue, however the property search link does not load.

The content/property-search.php file I am trying to load contains a script:

<script src="//idx.diversesolutions.com/scripts/controls/Remote-Frame.aspx?MasterAccountID=115580&amp;SearchSetupID=143&amp;LinkID=0&amp;Height=2000"></script>

What am I missing to be able to get this script to execute when loaded via AJAX? If I insert it into the home page directly it works without issue so it must be related to the jquery/ajax.

Pointy
  • 405,095
  • 59
  • 585
  • 614
MistaBond
  • 1
  • 1

1 Answers1

0

Loading .js scripts via ajax is not a good idea since .js scripts functionality is always bound to the loaded HTML DOM and my not work properly if loaded asynchronously via ajax after the DOM is fully loaded.

What you can do is loading the script once the ajax response is completely received using javascript functions like getScript() or .append().

See this answer here on how to use javascript to append an external script to your page:

Community
  • 1
  • 1
Ammar
  • 3
  • 3