Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

Pass HTML memory block to IE Browser?

Is there a way to pass a memoryblock containing a HTML page to an browser instead of creating a temporary file that the IE browser reads from?

//LeprA
0
LeprA
Asked:
LeprA
  • 4
1 Solution
 
DanRollinsCommented:
The simplest technique is described here:

    http://www.experts-exchange.com/jsp/qManageQuestion.jsp?qid=20026971

It boils down to opening a dummy page and then filling the innerHTML of the DOM 'body' element with your in-memory HTML.

There are other ways, but this is very easy to implement and will work in nearly all cases.  When there are images and so forth, you must provide a correct URL or file path for each (obviously, such objects are not actually part of the HTML source and the browser needs to obtain and load them separately).

-- Dan
0
 
DanRollinsCommented:
A couple of other techniques are covered here:
    http://www.experts-exchange.com/jsp/qShow.jsp?qid=20094394
including how to put the whole page -- including images and other external objects -- into a resource in a DLL or the EXE that hosts the browser control.

-- Dan
0
 
DanRollinsCommented:
hi LeprA,
Do you have any additional questions?  Do any comments need clarification?
-- Dan
0
 
LeprAAuthor Commented:
Yea sure i have,

I just wondered if il have the whole page inc Head- and Meta-tags in lets say a string is there a way to pass it to the IHTMLDocument2 or must i separete it into Head and Body by my self?

These questions did appear then i was using IXSLProcessor i thougt it was stupid to make an output to a file if il already have it in memory.

Maybe you have used it, and know a smoth way?

Thanks

//LeprA
0
 
DanRollinsCommented:
Sure!  It's all available in the DOM -- there's a HUGE section on these things in MSDN.  Give it a try!
-- Dan
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now