你们是否尝试窗户,开户。
您也可打电话到pageMethod,与开放者一起从您(服务方问询)中接过来,并将其应用于您的javascript。
。
Popup.aspx
<form id="form1" runat="server">
<asp:ScriptManager EnablePageMethods="true" runat="server"></asp:ScriptManager>
<div>
<script>
function call() {
var location = window.opener.location.href;
PageMethods.GetPhoneNumber(location, clientcall);
}
function clientcall(phone){
alert(phone);
}
</script>
<a href="javascript:call();">Call</a>
</div>
</form>
Popup.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
public partial class Popup : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
public static string GetPhoneNumber(string referer)
{
// Put your code to call your database here
return "888-888-888";
}
}
呼唤页
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<script>
function opening() {
window.open("Popup.aspx","mywindow", "status=1,toolbar=1");
}
</script>
<a href="#" onclick="opening()">Ouvrir</a>
</body>
</html>