how to write two ampersand for javascript in wordpress?

Discussion in 'JavaScript' started by youlichika, Nov 17, 2010.

  1. #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.
    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&amp;&amp;iNum+1!=l){a.shift();}else if(iNum+1==l){a.pop()}else{a.splice(iNum,1)}
       //alert(b[i]);
       document.write(b[i]);
    }
    HTML:

     
    youlichika, Nov 17, 2010 IP
  2. youlichika

    youlichika Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    I have solved this problem, there should be write the code in a .js file.
     
    youlichika, Nov 18, 2010 IP