Background returned full HTML page code, how to open the show

Html snippet returned backstage, need to insert html tags, and return the entire html document, you need to rewrite the entire page.

Solution:

1. requires a transfer page, the entire page rewritten with document.write () method;
// POST arbitrary content and jump 
function StandardPost (HTML) { 
    localStorage.removeItem ( 'callbackHTML'); 
    localStorage.setItem ( 'callbackHTML', HTML); 
    window.location.href = window.location.href.split ( '/ H5 / ') [0] +' /h5/callBack.html '; 
}
2.callBack.html page:
<script>
    document.write(localStorage.getItem('callbackHTML'));
    document.close();
</script>

 

Guess you like

Origin www.cnblogs.com/liangziaha/p/12654750.html