getBodyFromHtmlDocument(html)

Extracts the contents of the <body> tag in from a full HTML document string. Useful when you need to load the content of the document in jQuery which cannot load a full HTML document but needs an HTML fragment instead.

foxpro
foxpro
$.get("somepage.html", function(html){ var body = getBodyFromHtmlDocument(html); // create something that jquery can work with $el = $("<div>" + body + "</div>"); });
getBodyFromHtmlDocument(html)

String content of what's inside <body> tag of the document passed.

Parameters

html
The full HTML document which contains a <body> tag.


© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic