Paul
Member
Registered: 16th Apr 02
Location: Oop north.
User status: Offline
|
Hi,
I have the below piece of code that I am trying to embed into another page.
Everytime the page loads it pulls me off to another page and doesn't stay within the iframe.
Any ideas why?
Any help is greatly appreciated
<script>
function LoginToOWA (server,domain,username,password) {
var url = "https://" + server + "/owa/auth/owaauth.dll";
var p = {destination:'https://' + server + '/owa/myemailaddress@domain.com/?cmd=contents&f=Calendar&view=weekly',flags:'0',forcedownlevel:'0',trusted:'0',isutf8:'1',username:domain + '\\' + username,password:password};
var myForm = document.createElement("form");
myForm.method="post" ;
myForm.action = url ;
for (var k in p) {
var myInput = document.createElement("input") ;
myInput.setAttribute("name", k) ;
myInput.setAttribute("value", p[k]);
myForm.appendChild(myInput) ;
}
document.body.appendChild(myForm) ;
myForm.submit() ;
document.body.removeChild(myForm) ;
}
</script>
<body onload="javascript:LoginToOWA('mywebmail.domain.com','logon domain','username','password');">
</Body>
:thumbs:
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
I'd take a guess that you're trying to do authentication in an iframe. Just about all web services out there don't let you do that and you have to authenticate in a pop-up so that the user can see the url of the authentication page.
Also, you don't need to put the javascript:; bit in the onload attribute of the body, just the function name and it's arguments.
|