Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes HTML, CSS and JavaScript and the fly likes Netscape7.1 and  window.createPopup() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Netscape7.1 and  window.createPopup()" Watch "Netscape7.1 and  window.createPopup()" New topic
Author

Netscape7.1 and window.createPopup()

Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello Everybody,
In my application I have used window.createPopup(); method at client side in my application and Iam getting this error in Netsacpe7.1 and Mozilla that window.createPopup() is not a function.
Can anybody tell me what is the alternative way to use another method instead of window.createPopup() ,as I ahve tried on msdn also but Iam not able to find any other alternative .
Thanks in advance , do tell me if you have any idea.


jasmine kaur
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
That sounds like that is an IE only properpty.

You are going to proabably use layers or use a real pop up window.

Eric
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Thanks for responding ,well I am using window.createPopup(); and it works perfectly in IE but it gaves the same error in Netscape71. and Mozilla .

Well I write a simple code
<html>
<head>
<tittle>Test</title>
<Script language="JavaScript">
var win1= window.createPopup();// At this line it says the same error as I told u eralier



</script>
</head>
<body>
This is a testing page for the script
</body>
</html>

I exceute this simple code but Iam getting the same error" window.createPopup() is not afunction" as I was getting earlier in Netscape and Mozilla. So csn u tell me what is other way to solve this problem. Please help me.

Thanks
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

createPopup is an Internet Explorer specific method, and most likely available only in the later versions of IE only.

You CANNOT use it if your page will be viewed in Netscape, Mozilla, or any other browser except IE. you will need to write your own Javascript code that uses the Javascript standard window.open method to create a pop-up window.

Here is some helpful info. on it
http://www.jennifermadden.com/162/examples/window1.html

Eric has made available some very good resources at his site -
Eric's site


HTH

Sonny


The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Thanks for responding and helping me, well whatever u have mentioned is correct and now Iam going through the link which u have given. So I will try and will tell u whether it has been solved or not.
Thanks for responding and helping me.
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello ,
I tried the window.open() is not the right solution and the error still persits in Netscape7.1 and same in mozilla ,now please tell me what is teh other way.
Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Code?
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
var oPopup = window.createPopup();

function popupSetStylePath(stl)
{

oPopup.document.createStyleSheet(stl);
}

// kontextove menu reagujici na prave tlacitko mysi
function popupContext(sMenu, w,h)
{ window.document.write("This is a value of SMenu:"+sMenu);
var oPopupBody = oPopup.document.body;

oPopupBody.innerHTML = document.all[sMenu].innerHTML;
oPopup.show(event.clientX, event.clientY, w, h, document.body);
document.body.onmouseup = popupClose;
}

// zavreni popup menu
function popupClose()
{ window.document.write("The popup window has been closed");
document.body.onmouseup = null;
oPopup.hide();
}
This is acode
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The code is IE only, you should look into using layers to create the same effect.
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 815
Hi Jasmine,
Just curious... why do you find the open method not suitable for what you are trying to do? You should be able to just use the open method and write whatever you want to it. Does this not work in NS7?

Rob
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Hi,
I have not tested that, but it should give you an idea.
If you put the following code into your page BEFORE this popup code, I expect your code to work in NS without any changes

Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

I dont get it, what's wrong with using window.open() ? I would say that's the simplest possible solution, esp. if you dont know a lot about Javascript
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello Everybody ,
Thanks for helping me well I will try all the ideas given by u now and will tell u whether its works or not.
Well see the problem is with window.createPopup() which is not supported by the Netscape7.1 and Mozilla , so thats why i asked for another way.
Well thanks for helping me and now iam going to use all the suggestions suggested by all of you.
Thanks alot.
I will get back to you soon.
Thanks
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 815
I'm with you on that one Sonny. I just got used to using open and normally just use that.
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
It is very nice object. You can look at ot here:
Popup Object
Ofcourse, if you dont intent to be completly cross-browser and fine with 98% of users that use IE.
I used it for example for context menu on multi frame page - everything else was just not working and I did not like how window.open() looked in that case.
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello everybody,
I tried to implement ur ideas but nothing is working ,
If you have any ideas or suggestions then do tell me.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Netscape7.1 and window.createPopup()
 
Similar Threads
websphere 4.0 ..help needed ..pl ..very very urgent..
JOB WANTED AS A SOFTWARE ENGINNER
EJB deployment descriptor
Connect to MYSQL through AIR
can it be possible to write xml doc into a string variable?