Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am working on a php page. When user clicks on the image, a popup window is shown. The popup window source in another html page. Is it possible to define the popup window source in the current php page?

Thanks in advance for the replies
Posted

1 solution

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)

XML
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>'
    )
);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900