click-ahhref
http://stackoverflow.com/questions/2353011/jquery-popup-window-return-value-to-parent && VIEW IT FIRST
var parent = $(parent.document.body);
$(parent).find('input#valStore').val(theVal);
$(parent).find('form#myForm').submit();
window.close();
$("#mylink").click(function(){
value = /* get some value */
window.opener.$("#myform .somehiddenfield").val(value);
window.opener.$("#myform").submit();
window.close();
});
http://stackoverflow.com/questions/1084408/jquery-can-do-this-popup-window-for-value
$('#popupDialog').dialog({
modal: true,
autoOpen: false,
buttons: {
'Cancel': function() {
$(this).dialog('close');
},
'Accept': function() {
$('#mainForm input#target').val( $(this).find('#widgetName').val() );
$(this).dialog('close');
}
});
$('#popupButton').click( function() {
$('#popuDialog').dialog('open');
});
<div id="popupDialog" title="Input a new widget name">
<p>
<label for="widgetName">Please input a new widget name:</label>
<input type="text" id="widgetName" />
</p>
</div>
http://www.javascriptkit.com/javatutors/remote2.shtml
<script type="text/javascript">
var anotherwindow=window.open("whatever.htm")
change the background color of the second window from main
anotherwindow.bgColor="black"
</script>
SECOND WINDOW
<html>
<head>
<title>Secondary window</title>
</head>
<body bgcolor="#FFFFFF">
<center>
<form>
<input type="button" onClick="window.opener.document.bgColor='yellow'" value="yellow">
<input type="button" onClick="window.opener.document.bgColor='lightgreen'" value="lightgreen">
<input type="button" onClick="window.opener.document.bgColor='white'" value="white">
</form>
</center>
</body>
</html>
沒有留言:
張貼留言