如何在当前页面中定义弹出窗口Source? [英] How to define popup window Source in the current page ?

查看:84
本文介绍了如何在当前页面中定义弹出窗口Source?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在php页面上工作。当用户点击图像时,会显示一个弹出窗口。另一个html页面中的弹出窗口源。是否可以在当前的php页面中定义弹出窗口源?



预先感谢回复

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

推荐答案

是的,这是可能的。您可以在页面内声明各种资源的内容。这对于缓存和其他一些东西是不好的,但如果您希望使用纯文本格式共享资源,或者希望保留该页面中页面所需的所有资源,则这可能很有用。





请参阅此处,了解用于促进此类资源的方案的说明。 http://en.wikipedia.org/wiki/Data_URI_scheme [ ^ ]



特别注意格式,如指定在我链接到的页面的第5部分。



示例(来自上面的链接)



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>'
    )
);


这篇关于如何在当前页面中定义弹出窗口Source?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆