473,395 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

why wont the function get called ?

Hi! why doesnt my computermove() get called second time round? Note: computermove() is done to this it out first...
Expand|Select|Wrap|Line Numbers
  1. function onclick(square) {
  2.  
  3.  var value = square.value;
  4.  if(value != 'X' && value != 'O')
  5.  {
  6.  
  7.  
  8. square.value = 'X';
  9. numMoves++;
  10. computermove();
  11. numMoves++;
  12.  
  13. }
  14. }//function onclick
  15.  
  16.  
  17.  
  18.  
  19. function computermove(){
  20.  
  21. if(b1_1.value=" ")
  22. {b1_1.value="O";}
  23. else if(b0_0.value=" ")
  24. {b0_0.value="O";}
  25.  
  26. }
Mar 25 '09 #1
3 1017
Dormilich
8,658 Expert Mod 8TB
can you post a link, so I can have a look at it (don't like to make up the HTML myself)?
Mar 25 '09 #2
oh um its in my google gadget .... but by just readin through the code it seems right, right?
Mar 25 '09 #3
Dormilich
8,658 Expert Mod 8TB
more or less. but there are some points to check:
is every variable set right?
is there any polymorphism making trouble? (it's good practice to not use variable/function names that JS already uses somewhere, e.g. onclick)
what does Error Console/FireBug say?
are the Events properly registered?
Mar 25 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Steve Westwood | last post by:
I have a WebForm button. Depending on calculation I wont to send a popup message to the web page. I am not sure of the approach. From the server side code I don't seem to be able to access the...
12
by: Ali | last post by:
I have the following web page with a script in it. <html> <head> <title>Make Your Own Objects test</title> <script>
6
by: Dufus | last post by:
<a id="MyDataList__ctl1_edit_Button" NAME="edit_Button" OnMousedown="EnableValidators('editGroup_');" href="javascript:{if (typeof(Page_ClientValidate) != 'function' || Page_ClientValidate())...
0
by: Phil | last post by:
I'm trying to add custom error handling for a 401 error. I've added this to my web.config: <location path="admin"> <system.web> <authorization> <allow roles="\" /> <deny users="*" />...
14
by: squash | last post by:
The following code works fine in Firefox/Netscape but wont work in IE. I suspect the problem is with one of these two simple functions. If there is no obvious error Ill paste the entire code. ...
1
by: ollyculverhouse | last post by:
Hi, I have a custom menubar which lets users jump to useful forms in my database. For example if I first open a form called 'Add Individual' then another called 'Add Firm', if i try opening...
5
by: sicapitan | last post by:
// add event _i = "'"+i+"'"; /* Event.observe('field'+i, 'blur', function(e) { updateField('"'+i+'"', "value", "$F(this)") });*/ Event.observe('field'+i, 'blur', function(e) { updateField("1",...
2
elamberdor
by: elamberdor | last post by:
A main movie on the root directory, calls in swf's on button press from "flash" folder, each contain one XML field that updates for each. XML located in flash folder. The XML displays fine when it...
0
by: tropix100 | last post by:
Hi, I am adding a hook for JournalRecord and JournalPlayback but for some reason my JournalRecordProc never gets called. I am using Vista. I am also using other hooks that are working and calling...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.