使用代码发布iframe [英] Posting iframe with code

查看:99
本文介绍了使用代码发布iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我的目的是同时验证两个系统中的用户.一个是我的.我开发了它.第二个是在不同的服务器上,我不知道如何在该服务器,cookie等上对我的用户进行身份验证.

因此,我决定发布第二个登录页面并自动填写必填字段.

我有用于身份验证系统的登录页面.我在此处放置了一个看不见的iframe,并将其链接到第二个系统登录页面.

现在,我正在尝试从父页面填充iframe登录字段(用户ID,密码),并同时发布父和iframe,但我无法使用javascript做到这一点.

我什至无法尝试"document.frames [0] .document.form [0] .submit()"等,因为我无法编写此脚本(intellisense不允许这样做.我不知道为什么我顺便使用VS2010)

感谢您提供有关发布iframe或传达iframe元素的帮助,或有关同时对两个系统进行身份验证的其他解决方案. (我正在使用ASP.NET)


谢谢.

Hello,

My aim is to authenticate users in two systems at the same time. One is mine. I developed it. Second one is in different server and i don''t know how to authenticate my users on it, cookies etc.

So i decide to post login page of Second one with auto filling necessary fields.

I have my login page which is used to authentication of my system. I put an invisable iframe here and link it to second system login page.

Now i''m trying to fill iframe login fields(userid, pw) from parent page and post parent and iframe at the same time but i cannot make it with javascript.

I cannot even try " document.frames[0].document.form[0].submit()" and etc because i can''t write this script( intellisense don''t let it. I don''t know why. I''am using VS2010 by the way)

I will be appreciated for your help about posting iframes or communicating iframes elements or another solution about authenticating to two system at the same time. (I''m using ASP.NET)


Thanks.

推荐答案

尝试这些
1)element.ownerdocument
2)在首页和iframe页面中声明一个变量,方法是:parent.variablename = this.现在变量名是iframe对象.

或使用scriptlet,但只能在IE浏览器中使用
try these
1) element.ownerdocument
2) declare a variable in main page and in iframe page write: parent.variablename = this. now variablename is iframe object.

Or use scriptlet but it works just in IE browsers


这篇关于使用代码发布iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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