I am interested in generating a "page fragment" so that I can use a simple XHR from another HTML resource and just insert it directly into the DOM. One might think of this as "webclipping" or "scraping" or "translation-free HTML insertion" or "in-line client-side includes" or "an improper almost-webservice". I want to try this without a listener-based webservice; just a few simple parameters packed into the URL and you get back the body portion of rendered ApEx page. But I'd also like to preserve most of the cool page rendering, processing, regions et cetera within.
My naive approach was to modify a page template by deleting most of the template content, mostly just leaving a lean Body section template chunk. However, there is, at least, a restriction that the head section must contain the <head> HTML tag and inside of that must the ApEx header substitution token. Is there a way to defeat that restriction? Or a more proper approach?
Thanks, Denes. I will just strip down the template as far as possible and then use the native jquery feature I just discovered:
----- Loading Page Fragments
The .load() method, unlike $.get(), allows us to specify a portion of the remote document to be inserted. This is achieved with a special syntax for the url parameter. If one or more space characters are included in the string, the portion of the string following the first space is assumed to be a jQuery selector that determines the content to be loaded.
However, this has launched me into explorations on Cross Origin resource sharing!