Re: [webdesign-396] Unobtrusive Javascript WHY?

From: Michael M.
Sent on: Tuesday, August 12, 2008 10:07 AM
On the subject of javascript pop-ups.... is the consensus that this is always bad?  As both a marketer & a consumer I can see the benefit of having pop-up windows without menus.  For example on Amazon if you are on a product page there is usually the link towards the top left to "see larger image".  It makes sense for that to not open an entirely new full size page, but rather a window big enough only for the picture.  Because the window is small, it also seems to make sense to strip all the menus, address bars, etc.

Here's an example link:

I don't know that much about Javascript.  Is the way they do it unobtrusive enough?  If code is needed to answer the question, below I pasted the parts that seemed relevant.  If there way is bad, how can you achieve a similar effect with better coding?


<script type="text/javascript" src=""></script><script language="Javascript1.1" type="text/javascript">
function amz_js_PopWin(url,name,options){
  var ContextWindow =,name,options);
  return false;

  registerImage("original_image", "", "<a href="+'"'+""+'"'+" target="+'"'+"AmazonHelp"+'"'+" onclick="+'"'+"return amz_js_PopWin(this.href,'AmazonHelp','width=700,height=600,resizable=1,scrollbars=1,toolbar=0,status=1');"+'"'+"  ><img onload="+'"'+"if (typeof uet == 'function') { uet('af'); }"+'"'+" src="+'"'+""+'"'+" id="+'"'+"prodImage"+'"'+" width="+'"'+"240"+'"'+" height="+'"'+"240"+'"'+" border="+'"'+"0"+'"'+" alt="+'"'+"The Simpsons - The Complete Eleventh Season"+'"'+"  /></a>", "<br /><a href="+'"'+""+'"'+" target="+'"'+"AmazonHelp"+'"'+" onclick="+'"'+"return amz_js_PopWin(this.href,'AmazonHelp','width=700,height=600,resizable=1,scrollbars=1,toolbar=0,status=1');"+'"'+"  >See larger image</a>");

<td class="tiny">&nbsp;<span id="prodImageCaption"><br /><a href="" target="AmazonHelp" onclick="return amz_js_PopWin(this.href,'AmazonHelp','width=700,height=600,resizable=1,scrollbars=1,toolbar=0,status=1');"  >See larger image</a></span>&nbsp;</td>

On Thu, Aug 7, 2008 at 11:54 AM, Joseph James Frantz <[address removed]> wrote:
Last night during our HTML/CSS Study Group, Lauryl and I were explain why standards and unobtrusive javascript are so important. In particular we focused on folks that feel the need to change a regular link into a JavaScript command.

Why is this bad practice? Because it takes control away from perfectly capable users. This just now struck home as a user in our office wanted to print a tracking page for a shipment but could not. Why not? The company had decided that links to tracking pages would use the JavaScript method instead of the standard <a href= HTML element. In addition, they had determined, that it should create a popup. Finally, that this popup should have no menus, buttons, address bar, or anything else that we, as users, need. Thus it was impossible in their window to print the tracking page.

Yes, I can and will change this users settings (and all of the others) to ensure that no site can do this in the future. Nevertheless it is something I should not have to do.

Hopefully this illustrates one more example for the group from last night, as to why it is really important to use Unobtrusive JavaScript, and why you should stay out of the users way as much as posisble.

Kind Regards,
Joseph James Frantz

Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Joseph James Frantz ([address removed]) from Cleveland Web Design and Development Meetup.
To learn more about Joseph James Frantz, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup Support: [address removed]
632 Broadway, New York, NY 10012 USA

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy