0

We are trying to ensure that information is seen even if javascript is disabled.

So we would like to create something that opens a popup as normal however if javascript is disabled it opens a new tab or window with the information. But if javascript is enabled it just opens the popup not the new window.

Is something like this possible and if so how would we do it?

Thank you.

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by valonesal
0

You could have the click be on an <a> tag with a target="_blank" which will open a new window. But if they have javascript enabled you can bind events to it with onlclick to open a popup and return false (to prevent the other window from opening;

0

Oh that sounds great could you please provide an example or the code I would use so I can see how it is done?

Im really trying to learn all of this.

Thank you.

0

Oh that sounds great could you please provide an example or the code I would use so I can see how it is done?

Im really trying to learn all of this.

Thank you.

This isn't exactly what has to be done but it's a start. Take a look at w3schools.com for more javascript tutorials on opening windows

<script type="text/javascript">
var popupSomeWindow = function ()
{
  window.open('someurltopopup', 'someparams=hello');
  return false;
};
<a href="someurltopopup?someparams=hello" target="_blank" onclick="return popupSomeWindow();">Popup or new window</a>
1

Ok I put this together and seems to work beautiful, thanks for the referral.

<a href="http://mywebsite.com" target="_blank" onclick="window.open('http://mywebsite.com','popup','width=507,height=600,scrollbars=yes,toolbar=no,menubar=no,'); return false"><MY LINK" /></a>

Edited by valonesal: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.