Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error in code


realpascal

Recommended Posts

The idea is to have an image on the default page, that will popup a new window with some information, when clicked.

 

For this I put the following code in catalog/default.php:

 

<script language="javascript" src="includes/general.js"></script>
<script language="javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=450,height=550,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>

 

And the following line in catalog/languages/dutch/default.php:

<?php echo '<a href="javascript:popupWindow(\'/prijsvraag/prijsvraag.htm\')"> <img src="/prijsvraag/test.jpg" border="0"> </a>'; ?>

 

I know the line in catalog/languages/dutch/default.php is wrong in many ways, but I can't figure out what the correct code should be like. As expected, I now only get a parse error in this line.

 

Any help guys ? (Girls?)

 

Pascal

Link to comment
Share on other sites

well first where to you want that url to appear?

 

next you dont need php to "echo" that

 

that is plain HTML and can be insterted where you need the popup...

 

Finally, you relize that popups are being a thing of the past in the wave of popup ads, most Browers including the upcomming release of the new IE browers will incorperate popup blocking that will render that javescript usless and nothing will happen when the user clicks the link

Link to comment
Share on other sites

I just reread you post

 

just paste

<a href="javascript:popupWindow(\'/prijsvraag/prijsvraag.htm\')"> <img src="/prijsvraag/test.jpg" border="0"> </a>

inside your "LANG FOLDER/index.php

 

WELCOME TEXT area....

 

but a better solution would be to use Javascript and a Hidden layer..

 

then you can have the information "popup" when the user either rolls over or clicks on the link, but it will not need a new window, as a layer will appear over the existing text

 

you have seen these used in the "new age" popup ads.. you know the flash the moves around on your screen and you can never get rid of it...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...