473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to get back the target

Hi

I'm stuck on setting a target for current page. say, the following
function is called

function Call_OnClick(index, nValue, PageID, TargetFrameID)
{
document.InputForm.PAGEID.value = PageID;
if ( TargetFrameID != null )
document.InputForm.target = '_new';
document.InputForm.submit();
}

to open another broswer. after this, the parent GUI doesn't display all
the component, few of bottons are gone. without exacuting the above
function, all are fine. I think it's the target setting problem (all
pages are governed by controller in this project).

Can anyone tell about this issue?

--
Thanks
John
Toronto

Jul 23 '05 #1
11 1688
Jc
john woo wrote:
Hi

I'm stuck on setting a target for current page. say, the following
function is called

function Call_OnClick(index, nValue, PageID, TargetFrameID)
{
document.InputForm.PAGEID.value = PageID;
if ( TargetFrameID != null )
document.InputForm.target = '_new';
document.InputForm.submit();
}

to open another broswer. after this, the parent GUI doesn't display all
the component, few of bottons are gone. without exacuting the above
function, all are fine. I think it's the target setting problem (all
pages are governed by controller in this project).

Can anyone tell about this issue?

--
Thanks
John
Toronto


How is the "parent GUI" being displayed? Is a frameset being used?
There's not enough information given for me determine why your parent
GUI isn't showing up in the new page (I think that is what you are
expecting), but if it isn't, it is because whatever URL you are
submitting to isn't returning what you expect (if your page is
generated server-side), or whatever code you are expecting to run to
generate your "parent GUI" isn't being executed on this new page.

Do you mean to use "_blank" instead of "_new"? AFAIK, "_new" doesn't
have any special meaning, and will simply open up a new window named
"_new", unless a window with a name of "_new" already exists, in which
case it will be used as the form target.

http://msdn.microsoft.com/library/de...ies/target.asp

Jul 23 '05 #2
Jc wrote:
Do you mean to use "_blank" instead of "_new"? AFAIK, "_new" doesn't
have any special meaning


_new isn't allowed as a target name and causes browsers to perform error
recovery. Some may treat it as _blank, some may treat it as a name with no
special features.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #3
It's embeded inside a JSP. a controller handles all the URL. the parent
GUI built in a basic template, which provides a buttons bar. the above
function

document.InputForm.target = '_new';
document.InputForm.submit();

let the controler knows a new page requested and the
controler(server-side,servlet server engine) pops up another JSP
(DHTML, with java-code,HTML and javascript).

after this pop up, it seemed the controler lose some info about the
parent GUI, didn't sent back the buttons on the bar.

without executing the above function, all are fine

Jul 23 '05 #4
Jc
john woo wrote:
It's embeded inside a JSP. a controller handles all the URL. the parent
GUI built in a basic template, which provides a buttons bar. the above
function

document.InputForm.target = '_new';
document.InputForm.submit();

let the controler knows a new page requested and the
controler(server-side,servlet server engine) pops up another JSP
(DHTML, with java-code,HTML and javascript).

after this pop up, it seemed the controler lose some info about the
parent GUI, didn't sent back the buttons on the bar.

without executing the above function, all are fine


It sounds like your form needs to send some more info back to your
controller, perhaps there is some state info it needs that isn't being
posted back? Some URL parameters perhaps? You can add hidden inputs to
include this information in the popup request to the server. Also,
don't forget to change '_new' to '_blank', which may or may not be part
of the problem.

Jul 23 '05 #5
Thanks.

but what's the info I need?
and how to send back to the control (I just know how to forward tothe
next page by submitting, this NEXT page is controller/configured by
main frame controller)?

I've tried replace '_new' with '_blank', but the controller couldn't
regconize it. Plus, this GUI is a small part in the whole GUI, I don't
even the whole architect.

Jul 23 '05 #6
Jc
john woo wrote:
but what's the info I need?
and how to send back to the control (I just know how to forward tothe
next page by submitting, this NEXT page is controller/configured by
main frame controller)?


I have no idea what the controller needs to display the GUI properly,
I'm just guessing that maybe it needs additional parameters or state
info passed to it. You could get an idea by looking at the URL
parameters (if any) on the main page that is spawning the popup.

As I mentioned in my last post, one way to send additional get/post
parameters is to use a hidden input, refer to your favorite HTML
documentation.

I'm not familiar with jsp, perhaps you should ask this question in a
java related group, as it is not really a javascript question/problem.

Jul 23 '05 #7
David Dorward wrote:
Jc wrote:
Do you mean to use "_blank" instead of "_new"? AFAIK, "_new" doesn't
have any special meaning
_new isn't allowed as a target name


Pardon?
and causes browsers to perform error recovery.
Which browser is that badly b0rken that it does not allow for any target
name?
Some may treat it as _blank,
Again, which browsers are you talking about?
some may treat it as a name with no special features.


Which is correct, and I can see no harm in that. What's your point, anyway?
PointedEars
Jul 23 '05 #8
Thomas 'PointedEars' Lahn wrote:
David Dorward wrote:
Jc wrote:
Do you mean to use "_blank" instead of "_new"? AFAIK, "_new" doesn't
have any special meaning


_new isn't allowed as a target name


Pardon?


http://www.w3.org/TR/html4/types.html#h-6.16
and causes browsers to perform error recovery.


Which browser is that badly b0rken that it does not allow for any target
name?


How can a browser be broken if it can't cope with a document including
something expressly forbidden? And which bit of "error recovery" did you
miss anyway?
some may treat it as a name with no special features.


Which is correct


No it isn't, the browser is supposed to ignore it altogether.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #9
David Dorward wrote:
Thomas 'PointedEars' Lahn wrote:
David Dorward wrote:
Jc wrote:
Do you mean to use "_blank" instead of "_new"? AFAIK, "_new" doesn't
have any special meaning
_new isn't allowed as a target name

Pardon?


http://www.w3.org/TR/html4/types.html#h-6.16


Hmmm, yes, you're right. However, the HTML 4.01 Transitional DTD says

| <!ENTITY % FrameTarget "CDATA" -- render in this frame -->
| [...]
| target %FrameTarget; #IMPLIED -- render in this frame --

It appears that many (most?) UA vendors never read or took heed of that
part of the specification, only of the DTD. Unfortunately , "_new" is
perfectly valid CDATA and so straightforward markup validation does not
show it as an error. What a junk! -- Why did they not specify

<!ENTITY % SpecialTarget "_blank|_self|_parent|_top" -- special targets -->
<!ENTITY % FrameTarget "%SpecialTarget; | NAME" -- render in this frame -->

in the first place? :-(
and causes browsers to perform error recovery.


Which browser is that badly b0rken that it does not allow for any target
name?


How can a browser be broken if it can't cope with a document including
something expressly forbidden? And which bit of "error recovery" did you
miss anyway?


ACK, ACK. Although switched from "_new" to "_blank" (and then often from
"_blank" to no `target' attribute) long ago, apparently I missed that part
all the years, too. Thank you very much for pointing out!
some may treat it as a name with no special features.


Which is correct


No it isn't, the browser is supposed to ignore it altogether.


ACK, ACK. However, many (most?) do not. But I agree that we should not
depend on that.
PointedEars
--
Alcohol and Math don't mix. So please don't drink and derive!
Jul 23 '05 #10
Thomas 'PointedEars' Lahn wrote:
http://www.w3.org/TR/html4/types.html#h-6.16
Hmmm, yes, you're right. However, the HTML 4.01 Transitional DTD says


DTDs can only express certain constraints, you have to read the prose for
any specification.
<!ENTITY % SpecialTarget "_blank|_self|_parent|_top" -- special targets
--> <!ENTITY % FrameTarget "%SpecialTarget; | NAME" -- render in this
frame -->


So "_blank", "_self", "_parent", "_top" OR a NAME token ... which would
include "_new"? :)

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #11
David Dorward wrote:
Thomas 'PointedEars' Lahn wrote:
http://www.w3.org/TR/html4/types.html#h-6.16 Hmmm, yes, you're right. However, the HTML 4.01 Transitional DTD says


DTDs can only express certain constraints, you have to read the prose for
any specification.


I already knew that, you should at least bother to try to read and
understand what I wrote.
<!ENTITY % SpecialTarget "_blank|_self|_parent|_top" -- special targets
--> <!ENTITY % FrameTarget "%SpecialTarget; | NAME" -- render in this
frame -->


So "_blank", "_self", "_parent", "_top" OR a NAME token ...


Yes.
which would include "_new"? :)


No. NAME tokens, in contrast to CDATA tokens, must begin with a
letter which in combination with the other values would both apply
to the specification's prose and allow for markup validation against
forbidden values, in contrast to the current DTD. For consistency,
the `name' attribute of `frame' elements should then be of type NAME,
too.

<http://www.w3.org/TR/html4/types.html#h-6.2>
PointedEars
Jul 23 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bud Zielinski | last post by:
Can someone point me to a script that will allow me to implement a "back button" in an HTA, since there is no history for HTA's. Understand this requires an array, is there any sample code out...
4
by: Ryan | last post by:
Greetings, I would like to know if I can name my main browser window so that I can link back to it from a pop-up window. I know using <A HREF="url" TARGET="name"> will name the new window being...
10
elamberdor
by: elamberdor | last post by:
Hello All! Well, I can load in swf's just loverly, but what I have is a sliding menu, with buttons in it, that when pressed, load an image into an empty movieclip. I really just need to know how...
3
by: The Frog | last post by:
Hi Everyone, I have a need to build a simple tool in Access 97 for my work that will allow someone to convert a database (supplied externally) back to an Access 97 format mdb file. The files...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.