填充未插入 iframe 中 FORM 标签中的文本框
我有一个问题 - 如果使用了 FORM 标签,我知道如何在 iframe 中的文本框中填写文本。但是如果文本框没有 FORM 标签怎么办?我尝试了一些代码变体但没有成功。假设代码如下所示:
<tr><td align="left" valign="top" class="etext">Please enter your search string:</td></tr><tr><td align="left" valign="top" class="formfieldpadding"><label><INPUT TYPE="TEXT" id="text" class="formfield" NAME="pse_164_etext" VALUE="" ></label></td></tr><tr><td align="right" valign="top" class="buttonpadding"><input name="submit" type="image" src="/blah/button1.png" alt="Submit Button" wcflags="IgnoreDBOCheck,TreatAsCDATA" style="width: 237px; height: 60px; border: none; padding-top: 0px;" /></td></tr>
How can i fill the VALUE of the textbox which is in iframe ????如果有人能帮助我,我真的很高兴,我的意思是真的!谢谢大家:)
I've got a question - i know how to fill in a text in a textbox which is in an iframe if there is the FORM-tag used. But what can i do if the textbox don't have the FORM tag? I've tried some code variations without success. Let's say the code looks like this:
<tr><td align="left" valign="top" class="etext">Please enter your search string:</td></tr><tr><td align="left" valign="top" class="formfieldpadding"><label><INPUT TYPE="TEXT" id="text" class="formfield" NAME="pse_164_etext" VALUE="" ></label></td></tr><tr><td align="right" valign="top" class="buttonpadding"><input name="submit" type="image" src="/blah/button1.png" alt="Submit Button" wcflags="IgnoreDBOCheck,TreatAsCDATA" style="width: 237px; height: 60px; border: none; padding-top: 0px;" /></td></tr>
How can i fill the VALUE of the textbox which is in my iframe ???? Would be REALLY glad if someone could help me, I mean REALLY! thanks guys :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将面临的问题是 JavaScript 不允许从父窗口访问 IFrame 内容。这是正常的安全限制。
您仍然可以通过从 Iframe 调用 javascript 来绕过它。您仍然可以从 IFrame 内部访问父窗口:
The problem you'll face is that JavaScript is not allowed to access IFrame content from the parent window. This is a normal security restriction.
You can still bypass that by calling javascript FROM the Iframe. You can still access parent window from inside the IFrame: