Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
186
rated 0 times [  192] [ 6]  / answers: 1 / hits: 21600  / 15 Years ago, tue, june 23, 2009, 12:00:00

I have an HTML page that opens another page via JavaScript. When a user clicks a button in the other page, I want to post a message in a DIV of the opening page via JQuery. I cannot put my finger on it, but I cannot seem to get this to work. Here is my opener page



<html>
<head>
<script type=text/javascript src=jquery-1.3.2.min.js></script>
</head>

<body>
<input type=button onclick=window.open('dialog.html', '_blank', 'height=200, width=300'); value=launch! />
<div id=testDiv></div>
</body>
</html>


When the user clicks the launch! button, a dialog will appear. The code for the dialog looks like this:



<html>
<head>
<script type=text/javascript src=jquery-1.3.2.min.js></script>
</head>

<body>
<input type=button onclick=updateOpener() value=Update Opener />
<script type=text/javascript>
function updateOpener()
{
var testDiv = window.opener.jQuery(#testDiv);
if (testDiv != null) {
alert(here);
testDiv.html(Updated!);
}
}
</script>
</body>
</html>


Surprisingly, the alert box appears. However, I cannot seem to update the HTML of the DIV in my opening page. Does anyone know how to do this?


More From » jquery

 Answers
4

You're referencing confirmDiv. Where is that DIV?


[#99256] Thursday, June 18, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quentinaveryb

Total Points: 102
Total Questions: 100
Total Answers: 93

Location: Colombia
Member since Mon, May 2, 2022
2 Years ago
quentinaveryb questions
Thu, Aug 6, 20, 00:00, 4 Years ago
Fri, Jul 17, 20, 00:00, 4 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;