Page 1 of 1

Moving script to an external file???

Posted: Sat Mar 24, 2007 6:30 pm
by paulbeckett
Hi Norman

Can you confirm if the following Norprice scripts, which are currently onpage, can be moved to an external file(s)...
<script type="text/javascript">
<!-- Extract and remember the US$ to UK£ rate
if ( document.cookie ) // only if cookies enabled
{
if ( document.cookie.indexOf('destcurr=') == -1 ) // cookie not set so lets set it
{
var baserate = -1;
var intialrate = -1;
var basecurrency = document.textor1.basecurrency.value; // our normal currency
var initialcurrency = document.textor1.initialcurrency.value; // our additional currency
for(var i=0; i <= 100 ;i++) // all the ISO codes
{
if ( iso == basecurrency ) baserate = curate; // look for the BASE to $ rate
if ( iso == initialcurrency ) intialrate = curate; // look for the DEST to $ rate
}
if ( (baserate > -1) && (intialrate > -1) ) // valid rate
{
document.cookie = 'destcurr=' + escape(initialcurrency + ':' + baserate + ':' + intialrate) + '; path=/'; // set the cookie
document.location.reload(); // and reload the page
}
}
}
//-->
</script>


and

<script language=JavaScript>
<!-- V1.17
var hidemain = 'GBP';
var hidealt = '';
var showonly = '';
var hidefraction = 100;
var mainsymbol = '£';
var cgiurl = 'http://80.243.178.177/cgi-bin/ca000001.pl';
function norpricepopup(){
var arg = '';
if ( arguments.length == 1 ) arg = '?' + arguments[0];
var pricewin=window.open('http://80.243.178.177/acatalog/norpricepopup.html' + arg, 'pricepop', 'height=100,width=400,toolbar=no');
pricewin.focus();
}
//-->
</script>


Paul

Posted: Fri Mar 30, 2007 9:55 am
by norman
The first block of code: Possibly - however you've not said what page(s)this appears on so I cannot be sure.

The second block: Sort of. What you've posted is the code AFTER Actinic has expanded CUSTOMVAR's and NETQUOTEVAR's. This isn't the code that's in your Templates. You could move this to an external file but only if you change all CUSTOMVAR's and NETQUOTEVAR's to their generated values. This would, of course, prevent you from altering these values via the CUSTOMVAR's and NETQUOTEVAR's.