By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,949 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,949 IT Pros & Developers. It's quick & easy.

Change new window from opening window

P: n/a
I have opened a new window and now want to change something in the
newly opened window. I am doing this.......

<area
href="javascript:tour('newwindow.htm','_blank','sc rollbars=yes,resizable=1,width=780,height=550,top= 0,left=0')"
onclick="javascript:setTimeout('changenewone()', 800)" shape="rect"
coords="9, 29, 44, 69">

<script type="text/javascript" src="id1.js">
function changenewone() {
window.location.newemail1.HideContent('id1');
</script>

I have named the new window "newemail1." I used a time delay hoping
that the new window would have time to open and then the attributes
could be accessed. I'm not targeting the new window correctly, I
suppose. What would be the correct way to do this? I am getting an
"object expected" error. Any help is appreciated.
Jan 20 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jan 20, 10:15*am, Joe Sent Me <greend...@jimlowe.netwrote:
I have opened a new window and now want to change something in the
newly opened window. I am doing this.......

<area
href="javascript:tour('newwindow.htm','_blank','sc rollbars=yes,resizable=1,*width=780,height=550,top =0,left=0')"
onclick="javascript:setTimeout('changenewone()', 800)" shape="rect"
coords="9, 29, 44, 69">

<script type="text/javascript" src="id1.js">
function changenewone() {
window.location.newemail1.HideContent('id1');
</script>

I have named the new window "newemail1." I used a time delay hoping
that the new window would have time to open and then the attributes
could be accessed. I'm not targeting the new window correctly, I
suppose. What would be the correct way to do this? I am getting an
"object expected" error. Any help is appreciated.
What is 'tour'? What is 'HideContent'? What is 'newemaill'?

And with the onclick event, you don't need 'javascript:'

How do you reference your new window after you created it?

typically you would do something like:
var someWin = window.open('newwindow.htm', blah, blah, ....)

And then with someWin you can manipulate the window.
Jan 20 '08 #2

P: n/a
SAM
Joe Sent Me a écrit :
I have opened a new window and now want to change something in the
newly opened window. I am doing this.......
<html>
<script type="text/javascript">

function pop() {
if(typeof foo == 'undefined' || foo.closed)
foo=window.open('','myTarget','width=500,height=40 0');
foo.focus();
}

function changePop(what) {
if(typeof foo == 'undefined' || foo.closed)
pop();
foo.location = what;
foo.focus();
return false;
}
</script>

<a href="myPage.htm" target="myTarget" onclick="pop();">
My Page</a(simple example 1)<br>
<a href="#" onclick="return changePop('page2.htm')">
Page #2</a(change page in popup - example 2)
</html>

--
sm
Jan 21 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.