Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Popup


timekiller

Recommended Posts

Posted

Hi

 

im trying to insert a open.window script to the language.php file in the language folder

 

the english.php has a define('TEXT_GREETING_PERSONAL', ' ... this is for the frontpage

 

the script i want to use:

 

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript">

<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

window.open(theURL,winName,features);

}

//-->

</script>

</head>

 

<body onLoad="MM_openBrWindow('http://www.meganart.dk/meganpop2.html','MeganArt','width=450,height=650')">

</body>

</html>

 

Is it possible to use the script between the echo'..' and if yes do I need to remove some of the code. Like </body>

</html> etc

 

If its not possible any idea where to insert the script. What i need is a window(popup) to appear when frontpage is loaded.

 

Any help would be greatly appriciated

Posted

It should work. Just use everything from <script> to </script> and see what happens.

 

what about this line?

 

onload="MM_openBrWindow('http://www.meganart.dk/meganpop2.html','MeganArt','width=450,height=650')"

 

if I insert everything from <script> to </script> and this:

 

onload="MM_openBrWindow('http://www.meganart.dk/meganpop2.html','MeganArt','width=450,height=650')"

 

the browser informs that it has been loaded but with an error and the scripts doesnt work :-(

Posted

 

onload="MM_openBrWindow('http://www.meganart.dk/meganpop2.html','MeganArt','width=450,height=650')"

 

I see those pesky quotes now.. the single quotes have to be escaped in order to tell php to interpret them literally instead as part of the code. The code is define('TEXT_MAIN','......'); and inside those '...' you cannot use any other single quotes or else the php interpreter will consider the first one found to be the end of the '....'

 

So "escape" the quotes like this:

 

onload="MM_openBrWindow(\'http://www.meganart.dk/meganpop2.html\',\'MeganArt\',\'width=450,height=650\')"

 

And see if that helps.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Posted

I see those pesky quotes now.. the single quotes have to be escaped in order to tell php to interpret them literally instead as part of the code. The code is define('TEXT_MAIN','......'); and inside those '...' you cannot use any other single quotes or else the php interpreter will consider the first one found to be the end of the '....'

 

So "escape" the quotes like this:

 

onload="MM_openBrWindow(\'http://www.meganart.dk/meganpop2.html\',\'MeganArt\',\'width=450,height=650\')"

 

And see if that helps.

 

 

mdtaylorlrim how can I thank you! Second time you are a big part of helping me. Thank you so much. The script works perfectly now!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...