HighDots Forums  

Re: Is a Javascript named window same as<A HREF TARGET> window?

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Is a Javascript named window same as<A HREF TARGET> window? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DU
 
Posts: n/a

Default Re: Is a Javascript named window same as<A HREF TARGET> window? - 11-03-2003 , 04:05 PM






Randell D. wrote:
Quote:
Folks
If I open a window using window.open and give it a name (ie call it
myWindow), can I also reference this window using the html tag <A
HREF=/xyz.html TARGET=myWindow).

It must be a secondary window, I believe.
You can reference a named secondary window with the target attribute but
the issue is that such window won't get the focus once the link is
clicked (the new document will load though). So, you need javascript
support enabled.

Quote:
I have tried but find that when I click on my <A> tag link it opens a new
window instead of using a previously javascript opened/named window of the
same name.
That shouldn't be.
Show the code, preferably just an url.

DU

I was wondering if they are considered different or if I have
Quote:
done something wrong. For more info, I have a different post (that nobody
has replied too probably because its a bit long) with the subject line
"Problems with target in hyperlinks"

All help, via the newsgroup is much appreciated,
thanks
randelld




Reply With Quote
  #2  
Old   
Randell D.
 
Posts: n/a

Default Re: Is a Javascript named window same as<A HREF TARGET> window? - 11-03-2003 , 05:08 PM







"DU" <drunclear (AT) hot-R-E-M-O-V-E-mail (DOT) com> wrote

Quote:
Randell D. wrote:
Folks
If I open a window using window.open and give it a name (ie call it
myWindow), can I also reference this window using the html tag <A
HREF=/xyz.html TARGET=myWindow).


It must be a secondary window, I believe.
You can reference a named secondary window with the target attribute but
the issue is that such window won't get the focus once the link is
clicked (the new document will load though). So, you need javascript
support enabled.

I have tried but find that when I click on my <A> tag link it opens a
new
window instead of using a previously javascript opened/named window of
the
same name.

That shouldn't be.
Show the code, preferably just an url.


Thanks for the prompt reply and the help...

I'm unable to make the actual pages available since the whole application is
on an intranet - I have been able to upload the page though on to a
webserver - It should be sufficient though cosmetically speaking, it looks
awful...

http://www.wiredwords.net/cmlist.html

The above page shows addresses - I filled my database with about 10,000
records for me to play with - random names, streets and other info...

Secondly, the above page showsa slimed down list. Also, at the same time, a
new window is opened (using window.open and called "contactManager"). Note
that a new window opens up and is "hidden" underneath the main cmlist.html
window.

Now... if you click on one of the names (to see the full record) on the
cmlist.html window (for example Mr Curt BlastnameAEIY) it has a target of
"contactManager".

I would expect the record is displayed on the "hidden" window (called
contactManager) - Instead, a new window is opened... Both were named
"contactManager" - the only difference is that one was named using
javascript, while the other was named from within an HTML A tag.

D'ya know why? D'ya know how I could fix it?

My javascript skills are new so I don't know if its something I'm doing
wrong, or if its something I'm doing wright, but is infact not
supported/permitted hence I don't know if I'm wasteing my time trying to get
it to work.

Your help is very much appreciated,

thanks
randelld.




Reply With Quote
  #3  
Old   
DU
 
Posts: n/a

Default Re: Is a Javascript named window same as<A HREF TARGET> window? - 11-03-2003 , 06:35 PM



Randell D. wrote:

Quote:
"DU" <drunclear (AT) hot-R-E-M-O-V-E-mail (DOT) com> wrote in message
news:bo6fug$h7f$1 (AT) news (DOT) eusc.inter.net...

Randell D. wrote:

Folks
If I open a window using window.open and give it a name (ie call it
myWindow), can I also reference this window using the html tag <A
HREF=/xyz.html TARGET=myWindow).


It must be a secondary window, I believe.
You can reference a named secondary window with the target attribute but
the issue is that such window won't get the focus once the link is
clicked (the new document will load though). So, you need javascript
support enabled.


I have tried but find that when I click on my <A> tag link it opens a

new

window instead of using a previously javascript opened/named window of

the

same name.

That shouldn't be.
Show the code, preferably just an url.




Thanks for the prompt reply and the help...

I'm unable to make the actual pages available since the whole application is
on an intranet - I have been able to upload the page though on to a
webserver - It should be sufficient though cosmetically speaking, it looks
awful...

http://www.wiredwords.net/cmlist.html

The above page shows addresses - I filled my database with about 10,000
records for me to play with - random names, streets and other info...

Secondly, the above page showsa slimed down list. Also, at the same time, a
new window is opened (using window.open and called "contactManager").
It's [attempted to be] created at load time so this will be filtered and
killed by most popup blockers: never open automatically a secondary
window without the user's explicit involvment.

newWinda("contactManager","/contactManagerWorkarea.html",780,470,1);
window.focus();

Note
Quote:
that a new window opens up and is "hidden" underneath the main cmlist.html
window.

You are trying to create what is referred as a popunder; it won't
succeed in a wide majority of cases because of suppressing of
unrequested popups in most browsers and/or with add-ons.

Quote:
Now... if you click on one of the names (to see the full record) on the
cmlist.html window (for example Mr Curt BlastnameAEIY) it has a target of
"contactManager".

I would expect the record is displayed on the "hidden" window (called
contactManager) - Instead, a new window is opened... Both were named
"contactManager" - the only difference is that one was named using
javascript, while the other was named from within an HTML A tag.
The one attempted to be created with javascript will not succeed most of
the time. The one with
<a href="..." target="contactManager" ...>
will create for the fist time that window.

Quote:
D'ya know why? D'ya know how I could fix it?

My javascript skills are new so I don't know if its something I'm doing
wrong, or if its something I'm doing wright, but is infact not
supported/permitted hence I don't know if I'm wasteing my time trying to get
it to work.

Your help is very much appreciated,

thanks
randelld.


Just remove the entire whole code regarding
newWinda(win_name,URL,width,height,scrollbars,menu bar). Let the user
customize (dimensions, scrollbars, window resizability, statusbar) the
secondary window by himself. I'd say your code's main purpose is to
control such window features and I think you should not.

Also you should validate your page with a validator. There are many
errors in your page.
Your code relies on <font> which is not recommendable and deprecated.
<form name="form1" method="post" target="new" action="">
I would remove target="new" in there: it's not logical.
Your SymError() code is canceling error events in MSIE 4+; this can not
be recommendable.

DU



Reply With Quote
  #4  
Old   
Graham J
 
Posts: n/a

Default Re: Is a Javascript named window same as<A HREF TARGET> window? - 11-03-2003 , 07:47 PM



Quote:
Secondly, the above page showsa slimed down list. Also, at the same
time, a
new window is opened (using window.open and called
"contactManager"). Note
that a new window opens up and is "hidden" underneath the main
cmlist.html
window.
This is true.

Quote:
Now... if you click on one of the names (to see the full record) on
the
cmlist.html window (for example Mr Curt BlastnameAEIY) it has a
target of
"contactManager".
Not on the URL you specified it hasn't.

Quote:
D'ya know why? D'ya know how I could fix it?
The 'www' links have the target of 'contactManager' and do open in the
window you want. The names on the other hand use onClick handlers
that trigger the form submission and the target of the form is 'new'
which is the third window.








Reply With Quote
  #5  
Old   
Randell D.
 
Posts: n/a

Default Re: Is a Javascript named window same as<A HREF TARGET> window? - 11-03-2003 , 10:06 PM




"Graham J" <me (AT) privacy (DOT) net> wrote

Quote:
Secondly, the above page showsa slimed down list. Also, at the same
time, a
new window is opened (using window.open and called
"contactManager"). Note
that a new window opens up and is "hidden" underneath the main
cmlist.html
window.

This is true.

Now... if you click on one of the names (to see the full record) on
the
cmlist.html window (for example Mr Curt BlastnameAEIY) it has a
target of
"contactManager".

Not on the URL you specified it hasn't.

D'ya know why? D'ya know how I could fix it?

The 'www' links have the target of 'contactManager' and do open in the
window you want. The names on the other hand use onClick handlers
that trigger the form submission and the target of the form is 'new'
which is the third window.
Ah! I can't believe it... I checked and checked my code - I rechecked my
code - I went to bed last night and slept thinking about a solution - I
awoke this morning and gave my code a fresh look and....

You're right... I'm wrong.... I can't believe I didn't find it earlier....
Many thanks for the help... I've got it working just the way I wanted...

Cheers...
randelld




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.