Hi,
So I append the code, below (these are two ASPX files, based on your
examples). Do I do something wrong?
Notice that the <form> in the provider affects a redirect to a
Wikipedia page. When I initiate the form-submit from inside the
iframe, or via direct call from the parent (when the provider and the
consumer reside on the same domain), the redirect works. But when I
initiate the form-submit via easyXDM, the redirect doesn't work.
Actually one can then see in the browser's status bar that the
Wikipedia page is being loaded, but it doesn't get displayed inside
the iframe. The iframe's displayed contents do not change.
Thanks in advance,
Ram
===== consumer =====
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="GuestRegistrationNew.aspx.cs"
Inherits="Login.GuestRegistrationNew" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="
http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Musix - Registration</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="easyXDM.min.js">
</script>
<script type="text/javascript">
function submitChild() {
//alert(myFrame);
var childForm = myFrame.document.getElementById("form1");
//alert(childForm);
childForm.submit();
}
function XDMsubmitChild() {
socket.postMessage("submit");
}
</script>
<script type="text/javascript">
var socket;
$(document).ready(function () {
socket = new easyXDM.Socket({
remote: "
http://localhost:41628/CreditCardLP.aspx",
onMessage: function (message, origin) {
alert("Received '" + message + "' from '" + origin
+ "'");
var elem = document.getElementById("p1");
// alert("trying to modify text element " + elem);
elem.innerHTML = message;
},
onReady: function () {
socket.postMessage("Yay, it works!");
}
});
});
</script>
</head>
<body class="divBackgroundH920">
<form id="Form1" runat="server" autocomplete="off" startup="true">
<div>
<iframe src="
http://localhost:41628/CreditCardLP.aspx" name="myFrame"
id="myFrame" scrolling="auto" width="300" height="300" >Your browser
does not seem to support frames</iframe>
</div>
</form>
<br><br>
<button onclick="submitChild()">Submit child (directly)</button>
<br><br>
<button onclick="XDMsubmitChild()">Submit child (via easyXDM plugin)</
button>
<div id="p1">The message will be written in here</div>
</body>
</html>
===== provider =====
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="CreditCardLP.aspx.cs" Inherits="WebMusix.CreditCardLP" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="easyXDM.min.js">
</script>
<script type="text/javascript">
var socket;
socket = new easyXDM.Socket({
onMessage: function (message, origin) {
alert("Received '" + message + "' from '" + origin +
"'");
var elem = document.getElementById("ppp");
alert("trying to modify text element " + elem);
elem.innerHTML = message;
//$("#ppp").html(message);
if ("submit" == message) {
//alert("special: trying to redirect");
//document.location.href = "http://
www.ynet.co.il";
//
var myForm = document.getElementById("form1");
alert("trying to submit the form " + myForm);
socket.postMessage("Father, I now submit");
//myForm.action = "
http://www.ynet.co.il";
myForm.submit();
} else {
socket.postMessage("Indeed it does!");
}
}
});
</script>
<script type="text/javascript">
var tokenId = "<%# TokenId %>";
$(document).ready(function () {
/// send token up;
});
</script>
</head>
<body>
<p id="ppp">some text</p>
<form id="form1" name="form1" action="
http://en.wikipedia.org/wiki/
Phases_of_Venus" onsubmit='alert("going to submit")'>
<input type="hidden" name="shmutzy" value="y"/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>
=================