I have written following code to pass File1 variable to Javascript, but its not executing, and I’m not sure why. When I use alert with File1, it works – but the document.write script is not working. Any help?
<script type="text/javascript">
var Order[0]="1";
var Order[2]="2";
var Order[3]="4";
var File1=Order[2]+"/"+Order[0]+"/"+%Order[4];
document.write("<script type='javascript' src=http://abc.com/i_sale_third/10957/'" + File1 + ">";
</script>
Well, you did mess up your single quotes in the
document.write. I fixed it in this, see if it works:Edits. Try the following code.
Maybe the little
%is messing it up too right beforeOrder[4](and beside the fact that you may not have definedOrder[4]). I also added the console.log to your code so open up your console (in Chrome and Safari it is dev tools). You also didn’t need to repeatvarkeyword (you can separate them by commas if you didn’t know) and according to @ajax333221 (and me) you need to initializeOrderby doingOrder = []: