Using pgFetch() to get a section of XML

Using XMLHttpRequest() to configure entire ToolBook pages.

Using pgFetch() to get a section of XML

Postby Clifton » Thu Nov 21, 2024 1:30 pm

GOAL: To retrieve a portion of an XML and manipulate the results.

XML that contains menu HTML code used as a boilerplate

XML for the menu page that loads the above code using pgFetch()
  • pgFetch() is called with the notify parameter set to this.name to send a user event to the object that called the function.
  • pgFetch() is called with the loadPage parameter set to a section tag of the XML called <theMenu>. Since this tag contains only string data, pgFetch() will return only the string (or in this case the HTML boilerplate code). Otherwise, if <theMenu> contained other tags and functions definitions, the return from pgFetch() would've been an XML document. If one of the sub-tags was <theCode>, then it could be accessed as
    [e.data]["theCode"]
    in the user event function.

RESULT when loaded . . .
     
    Image
Clifton
Site Admin
 
Posts: 781
Joined: Tue Jan 14, 2014 1:04 am

Return to XML Configurations – Plugin Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron