how to write two ampersand for javascript in wordpress?

Discussion in 'Web Design and Development' started by youlichika, Nov 17, 2010.

  1. youlichika macrumors member

    Joined:
    Aug 27, 2010
    #1
    I use wordpress 3.0.1 and install Exec-PHP plungin.
    I edit the code in admin panel- pages - html cede. I want to add some javascript in a custom page. when the code use two ampersand. it occupy wrong. `& &` become `& # 0 3 8 ; & # 0 3 8 ;`(the original code has no space) How to solve this problem? thanks.
    Code:
    for(i=0;i<3;i++)
    {
       var l=a.length;
       //alert(l);
       var iNum=parseInt(Math.random()*l);
       //alert(iNum);
      
       b[i]=a[iNum];
       if(iNum==0&&iNum+1!=l){a.shift();}else if(iNum+1==l){a.pop()}else{a.splice(iNum,1)}
       //alert(b[i]);
       document.write(b[i]);
    }
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    I'd say don't edit it from the admin-panel. Go straight to the file.
     
  3. youlichika thread starter macrumors member

    Joined:
    Aug 27, 2010
    #3
    Thanks, I have solved this question, just write the code to a out js file.
     

Share This Page