OrderSomewhereChaos   
  

Wiki Home

List New Updates

Find Page

Back To
The Web Site

Back To
The Journal


 

 


Wiki: Java Script Notes

Here's a Popup window call:

  <a
  href="/homes/pop/howgreen/hg0.asp"
  target="_blank"
  title="How Green is my Home?"
  onClick="javascript:popFlex(
     '/homes/pop/howgreen/hg0.asp',
     'winHG',
     '380',
     '380',
     'no');
     return false;">
  Launch</a>

Here's the breakdown:

This line is for non-JavaScript Browsers:

  • <a href="/homes/pop/tour/tour.htm" target="_blank"

This line makes the ToolTip show up:

  • title="Tour an Earth Advantage Home"

This is the tag that makes JS-aware browsers do some JavaScript when the link is clicked:

  • onClick="

This tells browsers that some JavaScript is coming:

  • javascript:

This tells browsers to send a bunch of values to the JavaScript function "popFlex":

  • popFlex('/homes/pop/tour/tour.htm','winTourEA','539','395','no');

This tells browsers that if the popFlex function ran okay, then they should *not* try to launch the link that we set up in the first line above. If you set this to true, you'll get the JavaScript pop up window *and* the link in a new blank window. You'll get two total windows.:

  • return false;

For completness sake, all of this JavaScript goes inside the OnClick Attribute, and this is the closing quotation mark.

  • "

Finally, we've got the actual piece of text (or image) that the link is applied to.

  • >Launch</a>


// popup window functions ===========

function popFlex(URL,winName,W,H,scroll)

{

if (scroll == "no")

{scroll = "scrollbars=no"}

else if (scroll == "yes")

{scroll = "scrollbars"}

window.open(URL, winName,"top=0,left=30,width="+W+",height="+H+",resizable=no,"+scroll+"")

}

// /popup window functions =========




-- Last edited December 29, 2004
- Click any question mark to add a new page.

Search on: Java Script Notes


 

 

     
 

Menu

Notes Mode Ghia Mac Mail Up Home