
可以用正则表达式实现。
windowlocationsearch是你的查询字符串
"id=123"用下面的正则表达式提取出查询字符串的值
/[\&]id=([^&=])/i所以就有下面的代码:
var matches = /[\&]id=([^&=])/iexec(windowlocationsearch), idif(!matches) {
// 参数不正确:没有指定 id,可以在这里做一些其他的处理
}
else {
id = decodeURIComponent(matches[1])
// 这就拿到 ID 了
}
iframe:
content: '<iframe id="iframe1" src="" style="" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>'
方法:
var a = documentgetElementById('iframe1')contentWindowdocumentgetElementById('a)value; //输入值
var a= documentgetElementById('iframe1')contentWindowdocumentgetElementById('a')defaultValue; //默认值
以上就是关于js获取地址栏参数document.getElementById("").innerHTML全部的内容,包括:js获取地址栏参数document.getElementById("").innerHTML、在qq邮箱或163邮箱登录界面,怎么用js从frame里的document获取文本框、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)