This discussion is archived
3 Replies Latest reply: Mar 5, 2013 11:45 PM by Denes Kubicek RSS

HTML page fragment

655964 Newbie
Currently Being Moderated
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?
  • 1. Re: HTML page fragment
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    I think you can't go arround the restriction in the page template.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------
  • 2. Re: HTML page fragment
    655964 Newbie
    Currently Being Moderated
    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.
    -----
    [http://api.jquery.com/load/]

    However, this has launched me into explorations on Cross Origin resource sharing!
  • 3. Re: HTML page fragment
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    O.K. but I still do not understand what the actual problem is.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points