Yes, it is possible. You can declare the contents of all kinds of resources inside the page. This is bad for caching and a few other things, though can be useful if you wish to share resource using a text-only format, or would like to keep all resources needed by a page in that page.
See here for an explanation of the scheme used to facilitate this type of resource.
http://en.wikipedia.org/wiki/Data_URI_scheme[
^]
Pay particular attention to the Format, as specified in Section 5 of the page I linked to.
Example (from above link)
window.open('data:text/html;charset=utf-8,' +
encodeURIComponent( // Escape for URL formatting
'<!DOCTYPE html>'+
'<html lang="en">'+
'<head><title>Embedded Window</title></head>'+
'<body><h1>42</h1></body>'+
'</html>'
)
);