createpopup() questions

Posted on 2004-09-22
Medium Priority
Last Modified: 2008-01-09
I have two questions:
1. Can you hide the scrollbar when using the createpopup method?
var oPopup = window.createPopup();
var objDocument = oPopup.document;
No matter what I do the scrollbar always appears on the popup. The height of some of the HTML is set to 100% could that be the cause?

2. The HTML above contains a link to some javascript <script language="javascript" src="myJSfile.js"></script> but it does not appear to load this javascript because I get an object not found when calling when one of the methods within myJSfile.js. Can the popup window load javascript dynamically or does the javascript have to be typed out within the page?  I have verified that typing the javascript out in the HTML variable does work.

Thanks in advance for your help.
Question by:dswisstack
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 36

Expert Comment

ID: 12127469
Hi dswisstack,

1) If you must use an IE-only createPopup() function, your code will show a scrollbar because of the way you're calling it.

Do this:

var oPopup = window.createPopup();
var objDocument = oPopup.document.body;
objDocument.style.border = "1px solid black";
objDocument.innerHTML = HTML;

Since you're using createPopup(), the innerHTML shouldn't matter anyways.

Apparently, though, as I was reading your question, I noticed that you can't use innerHTML because you're including a whole document. As per say, you can set your body style to overflow:hidden; or even overflow-y:hidden since this is going to be IE only. However, the default overflow:auto; should work AS long as your document doesn't exceed the window.

Note, that you can set the window height here:


Just change 166 to something higher since including a document always adds one line of space at the top and the bottom.

2) Try my suggestions above first and we'll see...


Author Comment

ID: 12127634
overflow:hidden worked great and answers question #1

But I still cannot get #2 to work any ideas there?

Here is some more info:
I have a link to a stylesheet in the HTML as well and it loads the stylesheet just fine.
<LINK href="my.css" type="text/css" rel="stylesheet">

but the next line does not appear to load...
<script language="javascript" src="myJS.js"></script>

When I cut the contents of myJS.js and include it in the HTML it works.

Thanks Zyloch!
LVL 36

Expert Comment

ID: 12127718
That's odd. What is in your JS if you can show me...
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 12127834
It's really nothing out of the ordinary....

Within the <body> of the HTML on the last line I have this...
<script language='javascript'>RegisterMiniCalendar('MiniCalendar1', '09222004', 'MiniCalendar1DayCell09222004', true, 'doNothing', 'HandleDateSelected')</script>

The function RegisterMiniCalendar is in a script that is included in the HTML's <head> element as...
<script language="javascript" src="/Javascript/MiniCalendar.js"></script>
SRC is a fully qualified path the the file. I have validated that the SRC is correct by calling another JS file in the same location that is an ASPX page (JS.aspx) and setting a break point (the break point gets hit).

If I take the function out of the include and just put it within a <script> block in the HTML variable it finds it and everything works great. But I'd prefer not to do it this way.

LVL 36

Accepted Solution

Zyloch earned 500 total points
ID: 12127895
We can try it the Microsoft way (since this is IE only anyways)

On your main page have this:

<download id="pop1" style="behavior:url(#default#download);" />

Then in your <script> tag have a function like this:

function oDone(src) {

Call it when you need to with this:


This may be better in that you don't have to store the contents in a HTML variable.

Author Comment

ID: 12127937
It appears that the includes have not loaded by the time that the RegisterMiniCalendar function is called. Therefore it does not exist. I wrapped the RegisterMiniCalendar call within a method and call it on the window's onload event and the problem is solved.

Thanks again for your help Zyloch!

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question