mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 20:00:49 +08:00
init project
This commit is contained in:
35
public/editormd/examples/php/upload_callback.html
Normal file
35
public/editormd/examples/php/upload_callback.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
这是同域下的callback页面,本页面在iframe内,所以只要通过window.parent就能操作父窗口的元素
|
||||
-->
|
||||
<script type="text/javascript">
|
||||
var query = {};
|
||||
var urlParams = window.location.search.split('?')[1];
|
||||
urlParams = urlParams.split("&");
|
||||
|
||||
for (var i = 0; i< urlParams.length; i++)
|
||||
{
|
||||
var param = urlParams[i].split("=");
|
||||
query[param[0]] = param[1];
|
||||
}
|
||||
|
||||
var imageDialog = window.parent.document.getElementById(query['dialog_id']);
|
||||
|
||||
if (parseInt(query['success']) === 1)
|
||||
{
|
||||
imageDialog.querySelector("[data-url]").value = query['url'];
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(query['message']);
|
||||
}
|
||||
|
||||
location.href = "about:blank";
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user