Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 05:48 - Oct 02, 2007  

mary2

How do I have my website links pop up in a new window without being blocked by pop up blockers?

I have a website and I want to put some links in the site that refer to another website, but I dont want the user to leave my site while having the opportunity to view the other site. I implemented the following:

<a href-'link.html' target='new'>My Link</a>

but when it actually shows on the site, every time I click it my Google pop up blocker doesn't allow me to view the site. I know I've been to other sites where I click on the link and it opens in a new window, and those are not blocked by the pop up blocker. Does anyone know how I can accomplish this with simple HTML?

Answer Discussion
Tutorials

 

nidhi

Date:: Oct 08, 2007

Time:: 07:14

have u tried using javascript to see if that makes a difference?

get your hyperlink to call a js function

<a href="javascript:showpopup()">my link<a>

and your js function would have something like this in it

function showpopup()
{
 window.open ("http://www.bbc.co.uk","mywindo...);
}


alternatively, if that doesnt work, open up a blank page then write your html code in there which automatically loads the page of your choice

function showpopup()
{
window.open ("","mywindow1","status=1,width=350,height=150");
document.write('Generate Your Code Here');
}


sample code you can use to generate - just check this out
http://www.tips-tricks.com/automa.asp


mary2

Date:: Oct 11, 2007

Time:: 03:50

Nidhi,

That first function that you gave me doesn't seem to work. It is giving me an error, it is telling me that an Object is expected on line 1, character 1.

J

rcastagna

Date:: Oct 11, 2007

Time:: 08:28

John,

I think you were really close in the code snip you posted. I've had most of my success using the following without it being destroyed by "most" pop-up blockers: <a href="http://www.castagna.net" target="_blank">Castagna.net web site</a>

Let me know if this works for you...

Take care,
Ric

mary2

Date:: Oct 11, 2007

Time:: 08:52

Thanks Ric,

I think that it worked. I'll let you know if I find out otherwise.

J

nidhi

Date:: Oct 12, 2007

Time:: 14:40

Hi John, I see you got the problem resolved now

regarding the code though, not sure whats going wrong there, I cut/pasted from my sample
We could do with some <CODE> style tags so it doesnt interfere with any sample html code posted

<HTML>
<head><title>js popup quomon example</title>
</head>

<SCRIPT LANGUAGE="JavaScript1.2">
function showpopup()
{
 window.open ("http://www.bbc.co.uk","mywindo...);
}
</SCRIPT>

<BODY>
<H1>JavaScript Popup Example</H1>
hello
<A HREF="javascript:showpopup()">my link<A>
</BODY>
</HTML>

Question Answered

This question has been closed, and points have been rewarded to the following experts:


nidhi: 10
rcastagna: 65

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es