/    Sign up×
Community /Pin to ProfileBookmark

Javascript Menu System – Open Link in New Window

I’ve taken over a website that uses a Javascript menu system. I haven’t got a clue who wrote the code for the menu system but I need to make a small change to it so that one of the menu links opens in a pop-up window. This is an extract of the code within a .js file that builds the menu links:

[CODE]
startMenu(‘mEmailUtils’,true, 160, 0, 160, subM, ”, false);
addItem(‘POP3 Email’, ‘javascript:poptastic(‘pop3.aspx?type=web&refresh=<%=vrefresh%>&host=<%=vmailserver%>&user=<%=vuser%>&pass=<%=vpass%>&open=<%=vopen%>’);’, ”);
addItem(‘POP3 Task Scheduler’, ‘index.asp?page=admin_pop3task&title=603’, ”);
addItem(‘Group Email’, ‘index.asp?page=admin_groupemail&title=217’, ”);
[/CODE]

Ignore the first addItem for the moment, I’ll come back to that in a moment. The second and third addItem’s show how things are at the moment. The first value is the name of the link and the second value is the URL. Now back to the first addItem….this is where I’ve attempted to call a Javascript function to launch the URL in a pop-up window. Quite obviously it doesn’t work. To complicate matters the link has to contain some ASp variables. So on my ASP page that includes the .js file I have the following:

[CODE]
vrefresh = rs2(“admin_pop3refresh”)
vmailserver = rs2(“admin_mailserver”)
vuser = rs2(“admin_mailusername”)
vpass = rs2(“admin_mailpassword”)
vopen = rs2(“admin_openemail”)
[/CODE]

I know these variables hold the correct values and I think I’ve used them within the URL correctly as well. So the issue must be with the way I’m trying to open the link in a pop-up window. I’ve tried a few ways of opening the link in a pop-up window but none have worked so far.

Sorry if there’s a lack of information here, but any ideas on how to achieve this would be appreciated.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 27.2006 — No guarantees with this first attempt:

addItem("POP3 Email", "javascript:poptastic('pop3.aspx?type=web&refresh=<%=vrefresh%>&host=<%=vmailserver%>&user=<%=vuser%>&pass=<%=vpass%>&open=<%=vopen%>')", "");

What is the third argument for [b]addItem[/b] supposed to be for?
Copy linkTweet thisAlerts:
@madhouseauthorJun 28.2006 — phpnovice....your the man. That worked :-)

As for the third argument in addItem I haven't got a clue what it's for. But none of the addItems' contain a value in it so I think I'll leave that alone while I'm winning.
Copy linkTweet thisAlerts:
@phpnoviceJun 28.2006 — You're welcome.

Cheers.
×

Success!

Help @madhouse 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 5.16,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...