开发者

javascript pop-up box

开发者_如何学GoOK so I haven't messed with JavaScript in a long time but I do remember some. I have tried Google but it hasn't proved to be what i wanted.

Let's say I have a link... when you click it -- a window pop-up box appears. You can submit the form... then when you press submit! The pop-up box with the form you just filled out would close and the page you clicked the box up box would be redirected....

How would I make that happen?


Try this:

Parent page:

<script type="text/javascript">
window.name="dansMainPage";
function popWin(link) {
  var w = window.open(link.href,link.target,'width=500,height=600,resizable');
  return w?false:true; // if popup blocker, use the default behaviour of the link
}
</script>
<a href="pagewithform.html" target="_blank"
onClick="return popWin(this)">Pop form</a>

child page:

<form target="dansMainPage" onSubmit="setTimeout(function() { window.close() },1000)">
.
.
.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜