LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2001, 09:00 PM   #1
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270

Okay for anyone who knows javascript! I am working or have a working script that makes it so Netscape or Internet Explorer open in a new window at a certain size, with the window not resizable and etc, but when I open the link and window up in Linux with Netscape or Mozilla, it doesn't recognize or I don't know how to get it to work to read the size of the new window. Instead of the window opeing to the specific size that I state in the script, it opens in a new window at the default size that the parent window is.

Here is my script in the head of the HTML tag:

<script language="JavaScript">

<!-- Start New Window Link JavaScript. -->

<!--

function openNewWin(pageToLoad, winName, width, height, center)
{ xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >=4) && (center)){
xposition = (screen.width - width) /2;
yposition = (screen.height - height) /2;
}
args = "width=" + width + ","
+ "height=" + height + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=1,1"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //NN Only
+ "screeny=" + yposition + "," //NN Only
+ "left=" + xposition + "," //IE Only
+ "top=" + yposition; //IE Only

window.open( pageToLoad,winName,args );

}

//-->


</script>

Here is what I put in the body for the link:

<p><a href="javascript: openNewWin('main.html','newWin',700,600,1)" onmouseover="window.status='Enter TrickyLive.com - Apoplexy Of The Mind';return true" onmouseout="window.status='';return true"><img src="main05.JPG" width="150" height="75" border="0"></a>

If anyone could help me out in making this work in Linux with Netscape or Mozilla that would wonderful.
 
Old 03-22-2001, 01:58 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Alright, maybe this will make it easier for someone to help me, All I really need to know is how Mozilla identifies itself in a javascript, like for example, Internet Explorer is IE, Netscape Navigator is NN, I need to know what Mozilla is if anyone knows.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript - what to use rather than window.close() then window.open() davee Programming 2 04-11-2005 08:28 AM
Is it possible to script window placement? thatto Linux - Software 1 02-22-2005 05:01 AM
close a window with script box_l Programming 0 07-27-2004 07:57 AM
Cannot activate Javascript within Python script Linh Programming 0 09-22-2003 11:51 AM
javascript like shell script? jpbarto Programming 5 07-31-2003 05:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration