• Horn Player – Computer Dude – Gig Pig …
  • Home
  • About
  • Blog
  • Services
  • Contact
  • Webmail
  • Terms

Robert A. Owen - Musician - Technology Leader

Music, Technology, Rants and Funnies - Randomness at its best!

  • Blog
  • Internet
    • IIS 6
    • IIS 7.5
    • Javascript
    • Web Design
      • WordPress
      • Coldfusion
  • Support
    • MicroSoft
      • Powershell
      • Surface
      • Windows10
      • Zune
    • PC-Care
    • Software
    • Virus
      • Email Scam
    • Vista Quest
    • Windows 7
  • Pictures
    • Instagram
  • Music
  • Friday Funnies
  • General
    • CoWorking
    • Gadgets
    • Politico
    • Random – TidBit
    • Rant
    • Review
    • Site of the Week
    • Useless
    • Xbox
      • Games
You are here: Home / Internet / Javascript / Simple Pop-up Window

Simple Pop-up Window

December 28, 2006 By Robert Owen

I tend to use this little bit of javascript quite a bit so I thought I would share. You can use this little javascript to add a “Pop-up” window effect to links in your website.

For example, if you have a page of product images and Item numbers you can make them link to a “Pop-up” window with the item details.

Making a lot of these pages can be very cumbersome so I suggest automating the page creation by pulling the item detail from a database. This can be achieved very simply by running a Cold Fusion Query… I’ll talk about that later.. But, for now here is the Javascript:
Place this first bit of code in the head of the document that will be calling the new window.

<script LANGUAGE=”JavaScript”>
<!–
function pop(url)
{
window.open(url,’profile’,’width=450,height=500,scrollbars,resizable’);
}

function printWindow(){
version = parseInt(navigator.appVersion)
if (version >= 4) window.print()
}
//–>
</script>

This is where we define the properties of the new window that will be created. We define a width of 450 pixels and a height of 500 pixels. This can be set however large/small you need it.
Then we say we allow scroll bars (in case our content goes beyond the new window size), and we allow the window to be re-sized.
Here are some of the features that we can use to define our windows:

  • channelmode – Specifies if window should be opened in channel mode. IE only.
  • fullscreen – Specifies if window should be opened in full screen mode. IE only.
  • height – Specifies the height of the window.
  • left – Specifies the x coordinates of the window in pixels. IE only.
  • location – Specifies if the location bar of the window should be included.
  • menubar – Specifies if the menu bar of the window should be included.
  • resizable – Specifies if window should be resizable.
  • screenX – Specifies the x coordinates of the window in pixels. NS only.
  • screenY – Specifies the y coordinates of the window in pixels. NS only. See “top” as well.
  • scrollbars – Specifies if window should contain scrollbars.
  • status – Specifies if the status bar of the window should be included.
  • toolbar – Specifies if the toolbar of the window (ie: reload button) should be included.
  • top – Specifies the y coordinates of the window in pixels. IE only.
  • width – Specifies the width of the window.

Now, we call this new window by creating our link with the following information:

<code>
<a href=”javascript:pop(‘detail.cfm’)”>Click here for more information.</a>
</code>

Note: the file name to be called must be enclosed in’ ‘.

© 2006 – 2009, Robert Owen. All rights reserved.

Related posts:

Default ThumbnailCSS – Long URL Default ThumbnailWow!! Long time now type! Default ThumbnailUpload Files with Coldfusion.. It’s Simple!! Default ThumbnailComputer Locked up?

Filed Under: Javascript Tagged With: Channel Mode, Cold Fusion, Fullscreen, Language Javascript, Little Bit, Location Bar, Lt, Menu Bar, Page Creation, Pixels, Pop Up Window, Product Images, Profile, Screen Mode, Screeny, Script Language, Scroll Bars, Url, Window Effect

Robert Owen A Horn Player turned salesman, turned Computer Consultant & Horn Player, Turn Network Engineer & Horn Player, Now Technology leader & Musician.... Well, How about a Horn player who does a lot of other stuff? More about me. FacebookInstagramLinkedInTwitter

To Stay up-to-date on all of my crazy Ramblings, enter your e-mail address below.

You'll be amazed!

Recent Posts…

  • What If? – Gig Edition
  • Feedback – two way street
  • Snow-pocalypse… and Cold
  • Snow-pocalypse 2025 – part 6
  • Snow-pocalypse 2025 – part 5

Recent Comments

  • David Gray on Create a Shortcut to open in your Alternate BrowserTwelve years on, this tip remains useful. Though I…
  • Sue K on Use the Snipping Tool to Capture MenusThanks you so much! I could never figure out how t…
  • aa on Increase IIS File Upload LimitsSuperb Robert..after wasting 2 days..this is perfe…
  • León on Windows 7 error 86Funciono para Windows 7 , también descubrí que la…
  • Nicole Larkin on Use the Snipping Tool to Capture MenusNine years later and your post is still helpful. T…

[footer_backtotop]
Content Copyright © 2025 OWEN CONSULTING · All Rights Reserved · Log in