Jump to content

This topic is 7648 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

This topic is 7648 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.