如何打开弹出窗口并向其发送JSON对象 [英] How to open a popup and send a JSON object to it

查看:229
本文介绍了如何打开弹出窗口并向其发送JSON对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 JSON 对象发送到 PHP 文件,而我的脚本在新的弹出窗口窗口中打开该PHP文件。是否可以通过POST方法(通过jQuery或没有它)发送它?

I want to send a JSON object to a PHP file while my script opens that PHP file in a new popup window. Is it possible to send it via POST method (by jQuery or without it)?

如果没有,我如何将JSON转换为 URL编码字符串?是否有任何JavaScript函数?

If not, how do I convert JSON to a URL encoded string? Is there any JavaScript function?

推荐答案

您可以使用输入创建表单(动态)(填写值的位置)使用JSON)和关于弹出窗口名称的目标属性( window.open()的第二个参数)。

You may create a form (on the fly) with an input (where you fill the value with the JSON) and a target-attribute regarding to name of the popup (second parameter of window.open()).

然后发送此表格。

这篇关于如何打开弹出窗口并向其发送JSON对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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