dual moniter setup using java script

Hi
I have a requriement, ther would be two screens. one scrren is to fill the application form and the other screen is for doumentaion used for  filling  the form . instead of pressing ALT Tab every time, we want to use the dual monter setup using java script.
please help to fix this one.
 Thanks in advance
onanarAsked:
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.

StealthyDevCommented:
You cannot achieve this using JavaScript or anyother browser scripting.
It can be alternatively achieved by changing the X,Y position of top and left of the second / first monitor.

You can find more in here:
http://stackoverflow.com/questions/57652/how-do-i-get-javascript-to-open-a-popup-window-on-the-current-monitor

Regards.
P.S.: As long as you know the x and y position that falls on the particular monitor you can do:
var x = 0;
var y = 0;
var myWin = window.open(''+self.location,'mywin','left='+x+',top='+y+',width=500,height=500,toolbar=1,resizable=0');

Open in new window

0

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
onanarAuthor Commented:
Thanks for ur reply. so where i need to tell this? i belive k this is java script which has mentioned in ur refferd link, can i achive by  using this ?

function getMouseXY( e ) {
    if ( event.clientX ) { // Grab the x-y pos.s if browser is IE.
        CurrentLeft = event.clientX + document.body.scrollLeft;
        CurrentTop  = event.clientY + document.body.scrollTop;
    }
    else {  // Grab the x-y pos.s if browser isn't IE.
        CurrentLeft = e.pageX;
        CurrentTop  = e.pageY;
    }  
    if ( CurrentLeft < 0 ) { CurrentLeft = 0; };
    if ( CurrentTop  < 0 ) { CurrentTop  = 0; };  
 
    return true;
}
0
onanarAuthor Commented:
please find my below code


Case I:
Code:
var left = (screen.width-250);
win1 =  window.open('C:\\data\\TestDualMonitor\\A1.html','A1','width=650,height=850,left='+left+',top=0,scrollbars=yes');
win2 = window.open('C:\\data\\TestDualMonitor\\A2.html','A2','width=650,height=850,left=0,top=0,scrollbars=yes');
Dual Monitor:
-      window 1 will appear in between two monitors, users can drag to any location .
-      window 2 on monitor 1, top left corner
 

Single Monitor:  
      - Both the windows are available in single monitor

Case II:
var left = (screen.width+500);
win1 = window.open('C:\\data\\TestDualMonitor\\A1.html','A1','width=650,height=850,left='+left+',top=0,scrollbars=yes');
win2 = window.open('C:\\data\\TestDualMonitor\\A2.html','A2','width=650,height=850,left=0,top=0,scrollbars=yes');
 

Single Monitor:
-      Window 1 is not visible, But the window is available on the task bar.




Note: In dual monitor screen, screen.width gives only the width of the primary monitor.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

StealthyDevCommented:
After using the attached function, you will get the full width of the monitor. ie, monitor1.width+monitor2.width

so you can easily find it is single monitor or dual.

Please run the below code and find the value of CurrentLeft and CurrentTop.

Regards.
function getMouseXY( e ) {
    if ( event.clientX ) { // Grab the x-y pos.s if browser is IE.
        CurrentLeft = event.clientX + document.body.scrollLeft;
        CurrentTop  = event.clientY + document.body.scrollTop;
    }
    else {  // Grab the x-y pos.s if browser isn't IE.
        CurrentLeft = e.pageX;
        CurrentTop  = e.pageY;
    }  
    if ( CurrentLeft < 0 ) { CurrentLeft = 0; };
    if ( CurrentTop  < 0 ) { CurrentTop  = 0; };  
 
    return true;
}

Open in new window

0
onanarAuthor Commented:
please correct me if i am wrong..i am using IE

function getMouseXY( e ) {
    if ( event.clientX ) { // Grab the x-y pos.s if browser is IE.
        CurrentLeft = event.clientX + document.body.scrollLeft;
        CurrentTop  = event.clientY + document.body.scrollTop;
    }

i will have to use CurrentLeft  in my window .open() and CurrentTop as top.

my requirement.

I will get two popups-
1 st pop up should be displayed in first moniter
2 nd pop up should be displayed in second moniter.

please advice me
Thank in advance
0
onanarAuthor Commented:
Hi. The above function is not working. I am getting java script errors. will i need to change in the above code?
0
StealthyDevCommented:
Hi again!

Just execute the below page in both single monitor and dual monitor system.

Do come back to me with the values printed on the screen.

Regards.
<body onmousemove="return getMouseXY()">
</body>

<script>

var CurrentLeft = 0;
var CurrentTop = 0;

function getMouseXY( e ) {
    if ( event.clientX ) { // Grab the x-y pos.s if browser is IE.
        CurrentLeft = event.clientX + document.body.scrollLeft;
        CurrentTop  = event.clientY + document.body.scrollTop;
    }
    else {  // Grab the x-y pos.s if browser isn't IE.
        CurrentLeft = e.pageX;
        CurrentTop  = e.pageY;
    }  
    if ( CurrentLeft < 0 ) { CurrentLeft = 0; };
    if ( CurrentTop  < 0 ) { CurrentTop  = 0; };  
	document.write(CurrentLeft + ":" + CurrentTop);
 
    return true;
}

</script>

Open in new window

0
onanarAuthor Commented:
Thanks for your response. I am getting values like  917 : 29. but it keeps changing. you want me to add these values in to my win.open() height and width?
0
StealthyDevCommented:
Oh, screen.width is also no use..

Try screen.availWidth ?

Regards.
0
onanarAuthor Commented:
sorry . i could not understand . please tell me what i could do with these values?
0
StealthyDevCommented:
No, forget about the old script, I was wrong.
Now, I ask you to check what is the value of screen.availWidth...

And after googling reg. this, I came to know that, your requirement is not possible. ie., detecting dual monitor. (Using script lang. in a browser)

I can suggest you one thing:
* In your open window method you are naming windows as A1 and A2.
* After keeping the window in the right place (using case-I, after first open). It is possible to load the next pages in the same window with the same name.

Regards

P.S.: Finally, what you are looking for is not possible.
0
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
Java EE

From novice to tech pro — start learning today.