<input type="text" onclick="window.frames('frames1').document.writeln('%253A');">
<iframe name="frames1"></iframe>还是你 iframe 的页面和当前页面不是同一个域名,Javascript 不允许跨域操作
<iframe name="frames1"></iframe>还是你 iframe 的页面和当前页面不是同一个域名,Javascript 不允许跨域操作
解决方案 »
- 求解JS的问题,我的构造函数怎么只能new一次
- request的属性为一个对象(如user类),怎么在jsp页面显示在表单标签中(如input,select)
- 为什么有的时候onclick在firefox下不管用啊
- 【请教】页面定时发送ajax请求,刷新页面导致页面内的其他按钮不能点击了
- 在火狐下怎么跳转
- 如何用javascript中promot获得参数实现跳转到任意页
- IE 7 中光标问题
- 100分求一倒计时js
- 关于以表单形式发送邮件,无法阅读的问题,谢谢帮忙!
- 如何取小数点后面的位数
- 梅花雪,过来救命啊~!~!~!
- 我想实现一个点击图片时,触发一个Onclick事件,进行判断该用户是否有足够的钱浏览该照片!!???
<input type="text" onclick="window.frames('frames1').document.writeln('aa');">
<iframe id="frame1"></iframe>是这个意思,当地址为
http://localhost/test/a.php
时没问题,但为
http://localhost/test/a.php?a=%253A
时就出现拒绝访问
var t = "%253A";
<input type="text" onclick="window.frames('frames1').document.writeln(escape(t));">
<iframe id="frame1"></iframe>再在frame时unsecape()试试
<iframe id="frame1"></iframe> //注意,你这里id是frame1,上面脚本中却是frames1改成<input type="text" onclick="window.frames('frames1').document.writeln('aa');">
<iframe id="frames1"></iframe>我的机器没有 PHP 环境,担我在本地使用 asp 是可以的
我的代码是临时在这里写的,可能写错了一点。按你的也试过了。你试过在地址栏上加?参数吗?参数在程序里不用调用,不过%253A时asp也是过不了,我都试过了:(
首先,你必须设置你的浏览器的internet选项-安全-自定义级别里的允许框架操作。
下面是aspx的例子,完全没有问题。例外,框架里面的文件必须结构完整。aspx的例子
z.aspx
========
<iframe name="xx" src="c.aspx?a=%253A"></iframe>
<input type="text" onclick="window.frames['xx'].document.open();window.frames['xx'].document.writeln('aa');">
c.aspx
===========
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>
<script runat="server">
void Button1_Click(object Source, EventArgs e)
{
if (RadioButtonList1.SelectedIndex > -1)
{
Label1.Text = "You selected: " +
RadioButtonList1.SelectedItem.Text;
}
}
void chkLayout_CheckedChanged(Object sender, EventArgs e)
{
if (chkLayout.Checked == true)
{
RadioButtonList1.RepeatLayout = RepeatLayout.Table;
}
else
{
RadioButtonList1.RepeatLayout = RepeatLayout.Flow;
}
}
void chkDirection_CheckedChanged(Object sender, EventArgs e)
{
if (chkDirection.Checked == true)
{
RadioButtonList1.RepeatDirection = RepeatDirection.Horizontal;
}
else
{
RadioButtonList1.RepeatDirection = RepeatDirection.Vertical;
}
}
</script>
</head>
<body>
<form runat="server">
<h3>RadioButtonList Example</h3>
<asp:RadioButtonList id=RadioButtonList1 runat="server">
<asp:ListItem>Item 1</asp:ListItem>
<asp:ListItem>Item 2</asp:ListItem>
<asp:ListItem>Item 3</asp:ListItem>
<asp:ListItem>Item 4</asp:ListItem>
<asp:ListItem>Item 5</asp:ListItem>
<asp:ListItem>Item 6</asp:ListItem>
</asp:RadioButtonList>
<p>
<asp:CheckBox id="chkLayout"
OnCheckedChanged="chkLayout_CheckedChanged"
Text="Display Table Layout"
Checked=true AutoPostBack="true"
runat="server"/>
<br>
<asp:CheckBox id="chkDirection"
OnCheckedChanged="chkDirection_CheckedChanged"
Text="Display Horizontally"
AutoPostBack="true"
runat="server"/>
<p>
<asp:Button id="Button1"
Text="Submit"
OnClick="Button1_Click"
runat="server"/>
<p>
<asp:Label id="Label1"
Font-Name="Verdana"
Font-Size="8pt"
runat="server"/>
</form>
</body>
</html>
你的框架名字写错了
window.frames('frames1').
~~~~
<iframe id="frames1"></iframe>
~~~~~~
<input type="text" onclick="window.frames('frames1').document.writeln('aa');">
<iframe id="frames1"></iframe>没有任何错误