Jump to content

fai960820

Members
  • Posts

    4
  • Joined

  • Last visited

fai960820's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. <script>int[][] num = new int[4][5];num[1][1]={0,1,2,3,4};alert(num[1][2]);</script> This give my an error " Uncaught SyntaxError: Unexpected token ] " (shown by chrome) #for the "int[][] num = new int[4][5];" line Please help.
  2. I know what is the problem! It only doesnt work in IE, others work.' (Only IE have problem) Is there a way to slove that? also, if i want alert_two to have arguments, like function show(){ document.write('<button id="a">Press Me</button>'); document.getElementById("a").onclick = alert_two("HelloWorld");} function alert_two(x){ alert(x);} It will alert when i press "Hello World" which i dont want , is there an way to slove that? (Not only IE) btw, really thank you for you help.
  3. Here is the problem... <button onclick="show()">HelloWorld</button><script type="text/javascript">function show(){document.write("<button id=\"a\">Press Me</button>");document.getElementById("a").onclick = function{alert("two");}} The "HelloWorld" button will work, it will overwrite (i want it overwrite) and show the "Press me" button. The problem is in the "Press me" button, it wont alert "two", there is no respown. If i change it like this... <button onclick="show()">HelloWorld</button><script type="text/javascript">function show(){document.write("<button id=\"a\">Press Me</button>");document.getElementById("a").onclick = alert_two();}function alert_two(){alert("two");} It would alert two when "Hello World" button is press, but not "Press Me" button. Where is my problem?? Please Help~
×
×
  • Create New...