Cold Fusion and opening a new sized window

I am trying to use Cold Fusion to open up a 'new window" within my Cold Fusion application.  I have several Java scripts I have used for HTML sites to open up new windows, but the scripts do not seem to work for calling up a new window to a certain size within my cold fusion application.  I do undertand that CF is a sever side application unlike Java with runs on the client side.

Is there a CF tag to achieve this  possibly? If so, how?

Currently, in my head tag I am using this:

<script>

function schools(){
schoolsWindow = window.open ("http://www.mydomain.com/schools.cfm?page=1021","books","scrollbars=yes,width=591,height=528");
}
</script>

then in my text, I have this:

To view the schools click <a href="javascript:schools()">here:</a>

However, CF will not open up  schools.cfm?page=1021 because it is a dynamic page.

Is there a special CF tag that will allow me to open up a new "sized" window to a dyamic page within my website?

Thanks




greeneye8Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rob_lorentzCommented:
think you are missing a ;

<a href="javascript:schools();">here:</a>
greeneye8Author Commented:
The semi does not enable the script to work.  The script works fine and I have been using it for years with html pop ups with the semi:

a href="javascript:schools()">here:</a>

The problem with Jave is that I don't think it can pass Cold Fusion variables through it.  So my question is, can Cold Fusion even do this.... open up a controlled window (size, scrolling, etc.) within a Cold Fusion application?

Here is an example of what I am trying to do:  If you visit:

http://icarealty.com/index.cfm

This is a CF site.  If you scroll down to the very bottom, I have a link on the right hand side called 'test'.  Currently that is linking over to another dynamic page on the site.  What I am trying to figure out is how can I make my 'test' link  or another link on that site open up a "new window" that I can control the size and other attributes of the window.  

Thanks
JeffHowdenCommented:
First of all, forcing a popup window on a user is an unfortunate UI decision.  That being said, the least you could do is make it so JavaScript isn't required to access the contents of the link.

http://jeffhowden.com/articles/links_and_javascript/

Second, JavaScript doesn't care what server-side language a particular link calls just as much as your server-side language of choice cares that it was requested by a browser (in a popup or not), HTTP analysis tool, a server process, etc.

Perhaps you could help the experts assisting with your question by giving a more accurate description of the problem than simply saying "CF will not open up ... because it is a dynamic page".  Are you getting a JavaScript error when clicking on the link?  Does the popup open?  If it opens, what are you seeing in the popup window?  Is it not the page you expected?  Does it result in a ColdFusion error?  Have you tried opening the link in a regular window?  Do you get the same or different results than when attempting to open it in the popup?
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

TeggertCommented:
In the html head part of your page add the following;

<script type="text/javascript">
<!--    
function newWin(theURL,winName,features) {
    window.open(theURL,winName,features);
}

//-->
</script>

Then for your link,
<a href="JavaScript:parent.newWin('factsheet.cfm?pi=100415','cf','width=400,height=230,scrollbars=no');">Test</a>

Of course replacing the width, height, and actual link with whatever you are aiming for. I just threw in factsheet.cfm with the pi of whatever was there when I clicked.

The javascript works with any webpage, assuming your user has javascript enabled. If they don't, there's not really a way to force a pop-up. There isn't anything specific to ColdFusion that does this function, and if there were, it would just be something to generate javascript similar to what I've posted. Hope that helps.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TeggertCommented:
For more information on window.open and what features you could pass,
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp
JeffHowdenCommented:
"The javascript works with any webpage, assuming your user has javascript enabled. If they don't, there's not really a way to force a pop-up."

This is not a completely true statement.  Teggert, you got him started off right by suggesting the use of a function instead of calling the window.open() method inline.  However, first, the "parent.newWin()" call is going to throw the OP for a loop.  Second, you're needlessly crippling the link for non-JS users.  Try something more like this instead:

<a href="factsheet.cfm?pi=100415" target="_blank" onclick="newWin(this.href, this.target, 'width=400,height=230,scrollbars=no'); return false">Test</a>

Non-JS users will get a new window.  JS users will get a popup.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.