/    Sign up×
Community /Pin to ProfileBookmark

how to open a page in already opend window

hi i have one jsp page in which there is one hyperlink called [COLOR=Blue]click here[/COLOR] when i click on this a new browser window gets opened with desired output in it

but the problem is that every time i click on link the new window gets open which i dont want.

what i want is once the new page gets opened then link should be disabled or if not then every time the page should open in same window

my current java script code is——->

<a href=”javascript onClick=feePage(this.form)” >

and function is——–>

function feePage(objForm)
{
var strUrl= ‘<%=strURL%>’;
var applnName='<%=WebConstants.FEES_APPLN_NAME_PROD%>’

win = window.open(“http://portal.sebi.gov.in/”+applnName+”/feesAction.do?submitButton=preCFDFees”+strUrl,”FeePage”,”width=800,height=700,resizeable,scrollbars=1“);
if (window.focus) {win.focus()}

}

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@cyber1Oct 13.2006 — try using self.focus();

[code=html]win = window.open("http://portal.sebi.gov.in/"+applnName+"/feesAction.do?submitButton=preCFDFees"+strUrl,"FeePage","width=800,height=700,resizeable,scrollbars=1");
self.focus();
[/code]


or simply win.focus();

If the window is open and it has the same name it should focus.

No need for the if test
Copy linkTweet thisAlerts:
@felgallOct 13.2006 — Your code has given the new window the name "FeePage" so every time the link is clicked it should open the page in that same window.
Copy linkTweet thisAlerts:
@nilesh1389authorOct 13.2006 — i requets u to test the solutions given, by creating and running dummy javascript similar to given by me in original problem and then suggest me a tested solution

as both above solutions are not working ofr me ?
Copy linkTweet thisAlerts:
@felgallOct 13.2006 — Provide a link to where it is not working as with the value you have in the second parameter of the window.open call the same window would be used if the same command is run multiple times. The problem must lie elsewhere in your code.
×

Success!

Help @nilesh1389 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...