Search code examples
phpjqueryhtmleuro

Assigning € to arrays


I am working on a website that does not display euro signs properly unless I put $euro; I know this is not ideal but its what have to work with.

I have an array of prices that is passed to the webpage via a jquery function but if I use $euro; it will print out $euro; rather than € And if I use the € symbol I get a �

Below is my code:

    <script type="text/javascript">

var terms = ["€6 IRELAND", "€15 UK/EUROPE", "€30 INTERNATIONAL"," FREE SHIPPING ON ORDERS OVER €100 (ISLAND OF IRELAND ONLY)"];

function rotateTerm() {
  var ct = $("#rotate").data("term") || 0;
  $("#rotate").data("term", ct == terms.length -1 ? 0 : ct + 1).text(terms[ct]).fadeIn()
              .delay(2000).fadeOut(200, rotateTerm);
}
$(rotateTerm);

</script>


<div class="custom_text">SHIPPING RATES: <span id="rotate">this</span></div>

Thanks in advance for any guidance on this?


Solution

  • This quick work around should do the trick for now while you work on a more elegant solution

    var terms = [ "6 IRELAND", "15 UK/EUROPE", "30 INTERNATIONAL"," 100+ ORDERS GETS FREE SHIPPING (ISLAND OF IRELAND ONLY)"];
    
    function rotateTerm() {
      var ct = $("#rotate").data("term") || 0;
      $("#rotate").data("term", ct == terms.length -1 ? 0 : ct + 1).text(terms[ct]).fadeIn()
                  .delay(2000).fadeOut(200, rotateTerm);
    }
    $(rotateTerm);
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <div class="custom_text">SHIPPING RATES: &#8364;<span id="rotate"></span>    </div>

    I just employed the HTML EURO Decimal Code €

    Hope that helps