-
Posts
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by fai960820
-
-
Thanks alot.
-
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.
-
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~
Multidimensional array error
in JavaScript
Posted · Edited by fai960820
This give my an error " Uncaught SyntaxError: Unexpected token ] " (shown by chrome) #for the "int[][] num = new int[4][5];" line Please help.