Jukkie Posted February 22, 2004 Posted February 22, 2004 Before I did use the CDML tag below this one works. CDML: <a href="[FMP-LinkRecID: format=details.htm, layout=WEB]" target="_blank">order</a> Accept that I want a popupwindow which is 450px x 100px without scrollbars & in the center ect. Now you can see the JavaScript I use. The problem I have is that when the action is happend the wrong FM record is shown. (It is always the last record in FM) JavaScript using CDML tags: <script language='javascript'> var testWindow=null; function test(mypage,myname,w,h,pos,infocus){ if(pos=='random'){ LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100; TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=='center'){ LeftPosition=(screen.width)?(screen.width-w)/2:100; TopPosition=(screen.height)?(screen.height-h)/2:100;} else if((pos!='center' && pos!='random') || pos==null){LeftPosition=100;TopPosition=100;}settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no'; testWindow=window.open('',myname,settings); if(infocus=='front'){testWindow.focus();testWindow.location='[FMP-LinkRecID: format=details.htm, layout=WEB]';} } </script> <a href="javascript:test('[FMP-LinkRecID: format=details.htm, layout=WEB]','test','450','100','center','front');">Click Here</a> I hope some can help me! Greetings Jukkie
Garry Claridge Posted February 22, 2004 Posted February 22, 2004 Try changing this: testWindow=window.open('',myname,settings); if(infocus=='front'){testWindow.focus();testWindow.location='[FMP-LinkRecID: format=details.htm, layout=WEB]';} } </script> to this: testWindow=window.open('',myname,settings); if(infocus=='front'){testWindow.focus();testWindow.location=mypage;} } </script> Good Luck. Garry
Jukkie Posted February 22, 2004 Author Posted February 22, 2004 Thanks Garry it works!!! I don't understand why the location is mypage! Can you our somebody else tell my? Greetings Jukkie
Garry Claridge Posted February 24, 2004 Posted February 24, 2004 The function called "test" is receiving the URL as a parameter: function test(mypage,myname,w,h,pos,infocus){ It is being sent from the <a>: <a href="javascript:test('[FMP-LinkRecID: format=details.htm, layout=WEB]','test','4 "mypage" is a now a variable containing the URL. All the best. Garry
Recommended Posts
This topic is 7916 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now