The "
elementToBeLoaded" is the ID of an element in your survey where you want to insert the dynamic text. So, assuming you want the dynamic text in a question, the source of that question might look something like this:
Code:
<!-- The static text -->
<p>This is some static question text...</p>
<!-- A container for the dynamic text -->
<div id="elementToBeLoaded"></div>
<!-- A script to insert the dynamic text -->
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:complete',function() {
$('#elementToBeLoaded').load('https://example.com #remoteContentToLoad');
});
</script>
The "
remoteContentToLoad" is the ID of an element in the remote HTML page that contains the text to be loaded. So, the source of the remote page (example.com) might look something like this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dynamic Text</title>
</head>
<body>
<div id="remoteContentToLoad">
This is the dynamic text that is to be loaded into the survey...
</div>
</body>
</html>
Also remember that the remote HTML page must reside on the same server as the survey.
More on the jQuery load() method -
api.jquery.com/load/