javascriptµ÷Óø¸´°¿Ú£¨¸¸Ò³Ã棩µÄ·½·¨
window.parentÓëwindow.openerµÄÇø±ð javascriptµ÷ÓÃÖ÷´°¿Ú·½·¨
1£º window.parent ÊÇiframeÒ³Ãæµ÷Óø¸Ò³Ãæ¶ÔÏó
¾ÙÀý:
a.html
Html´úÂë <html>
<head><title>¸¸Ò³Ãæ</title></head>
<body>
<form name="form1" id="form1">
<input type="text" name="username" id="username"/>
</form>
<iframe src="b.html" width=100%></iframe>
</body>
</html>
Èç¹ûÎÒÃÇÐèÒªÔÚb.htmÖÐÒª¶Ôa.htmÖеÄusernameÎı¾¿ò¸³Öµ£¬¾ÍÈçºÜ¶àÉÏ´«¹¦ÄÜ£¬ÉÏ´«¹¦ÄÜÒ³ÔÚIfrmaeÖУ¬ÉÏ´«³É¹¦ºó°ÑÉÏ´«ºóµÄ·¾¶·ÅÈ븸ҳÃæµÄÎı¾¿òÖÐ
ÎÒÃÇÓ¦¸ÃÔÚb.htmlÖÐд
Html´úÂë
<script type="text/javascript">
var _parentWin = window.parent ;
_parentWin.form1.username.value = "xxxx" ;
</script>
ʵÀýµØÖ·£º http://www.cnspry.cn/blog/attachments/window.parent ʵÀý/a.html
Ô´Â룺
1.a.html
Html´úÂë
<html>
<head>
<title>Ö÷Ò³Ãæ</title>
<script>
/** Ϊ²âÊÔIFrame×Ó´°¿Úµ÷Óø¸´°¿ÚµÄÈ«¾Ö±äÁ¿¶øÌí¼ÓµÄ²âÊÔ±äÁ¿ */
var parentVairous = "Ϊ²âÊÔIFrame×Ó´°¿Úµ÷Óø¸´°¿ÚµÄÈ«¾Ö±äÁ¿¶øÌí¼ÓµÄ²âÊÔ±äÁ¿";
function parentInvokeIFrame()
{
var iframeTest = document.frames["iframeTest"]; //ʹÓÃdocument.getElementById("iframeTest");ͬÑù¿ÉÒÔ
&n
Ïà¹ØÎĵµ£º
Ò»£¬JavaScriptÖеı£Áô¹Ø¼ü×Ö
abstract extends instanceof static & ......
½ñÌìżȻ¿´µ½ÁËconstructorÕâ¸ö¶«¶«£¬²»Ã÷°×ÓÃ;¡£Õҵ㶫Î÷±¸Íü
typeofº¯ÊýµÄÓ÷¨¿ÉÄܲ»ÓÃÎÒ¶à˵£¬´ó¼Ò¶¼ÖªµÀÔõôÓ᣶øconstructorÊôÐÔ´ó¼Ò¿ÉÄܾÍÄ°Éúµã¡£ÔÚ¡¶¾«Í¨JavaScript¡·Õâ±¾ÊéÖÐÓÐÌáµ½constructµÄÓ÷¨£¬µ«ÎÒÓÃ×Ô¼ºµÄ¼¸¸öä¯ÀÀÆ÷£¨IE7.0 / Firefox1.9 / Opera9.50£©²âÊԵĽá¹ûÈ´ºÍÊéÉÏ˵µÄ²»Ò»Ñù¡£µ«ÊÇÈÔÈ»ÊÇÓÐ°ì·¨Í ......
1£¬²»´ø²ÎÊýµÄʼþ£º
Á½ÖÖ·½Ê½£ºÖ±½Ó¸ø¶ÔÏóÌí¼Óʼþ,½ÚµãÌí¼Óʼþ
ÀýÈç¸øÒ»¸öidΪtab1µÄÌí¼Óonclickʼþ
µÚÒ»ÖÖÇé¿ö£º
var
t
=
document.getElementById(
"
NewTitle
"
);
t.onclick
=
function
showmsg(){
alert(
'
Hello!Wor ......
1.JSP
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv= ......
ÓÉÓÚTEXTAREAûÓÐmaxlength,²»ÄÜÕâÑùÏÞÖÆtextarea³¤¶È£¬ µ«Í¨¹ýJAVASCRIPT ¾ÍÄÜʵÏÖµ½
<mce:script type="text/javascript"><!--
function limitLength(obj, length) {
var desc = obj.value;
obj.value = substr(obj.value,length);
}
function substr(str,length){
......