JavaScript - Variable Visibilty / Usage
Hello everybody,
I have a little problem concerning variable visiblity and usage within inner functions. This is the javascript code: Code: function StateSuggestions() { states = []; var txtFile = new XMLHttpRequest(); txtFile.open("GET", "http://localhost:8182/www/search/GEMET.txt", true); txtFile.onreadystatechange = function(states) { if (txtFile.readyState === 4) { // Makes sure the document is ready to parse. if (txtFile.status === 200) { // Makes sure it's found the file. lines = txtFile.responseText.split("\n"); // Will separate each line into an array states.push("testInFunction") } } } states.push("testOutofIt"); txtFile.send(null); } The method "states.push("testoutOfIt")" works (adds an element to the array) but "states.push("testInFunction")" doesnt have an affect on the variable states although I gave the variable "states" as transfer parameter to the function. Can anybody maybe help me? Greetings, TsEMaNN Similar TutorialsHi, I have a simple page and a javascript that measure the time the user has spent on a page and I want that variable to pass as a link to another page (php). I'm stuck (rookie) with how to actually pass that on in the link. Here's my code: Code: <?php session_start();?> <html> <head> <script type="text/javascript"> /* This script and many more are available free online at The JavaScript Source :: http://javascript.internet.com Created by: Cody Shaffer :: http://codytheking313.byethost11.com */ var time=1; function timeHere() { time = time + 1; finalTime = time / 10; } </script> </head> <body> <div id="container"> <form id="form1" method="post" action=""> <label>Fill this Data <input type="text" name="1" id="1" /> </label> <p> <label> <input type="submit" name="2" id="2" value="Submit" /> </label> </p> </form> <a href="go/index.html">ads</a> </div> </body> </html> Thanks for the help Hi I am in the middle of building some API's for my site and have built a cernal for all API's to read but i dont want the user to add two script tags to their sites code so I was wondering how I could do this. These are not my real files but will give you the full view of what it is I am trying to do. - cernal.js Code: var error = function(o) { if(o !== '') { alert(o); } }; - pub109283746374.js Code: // include the cernal.js file here somehow // Do a small function that uses the error cernal function function ShowNotice() { if(API_KEY !== '' && API_KEY !== undefined) { alert('Success'); } else { error('Sorry but you have an invalid API key.'); } } - http://www.userswebsite.com/demoFile.html Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>WHOISearch API Demo</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://www.mysite.com/API/pub109283746374.js"></script> </head> <body> <script type="text/javascript"> //<![CDATA[ ShowNotice(); // Alerts 'Sorry but you have an invalid API key.' //]]> </script> <script type="text/javascript"> //<![CDATA[ API_KEY = 'pub109283746374'; ShowNotice(); // Alerts 'Success' //]]> </script> </body> </html> If anyone can help me it will help me so much with finishing these API's, please reply if you know how I can do this, Thank You. DJCMBear I am using firefox 8. Is there a way is seeing the details of its memory usage please? Many thanks for any help, S Code: function themeOne() { var thm = document.querySelectorAll("div.articles"); for( i = 0; i < thm.lenght; i++) document.thm[i].style.border = "5px solid red"; } So all I'm trying to do here is to change the styles of the div's that have a class attribute with the value "articles". The function call works and a NodeList is created and placed in the variable thm . But before the first pass of the for loop, firebug is telling me that thm is undefined. You can see in the picture below that thm was infact defined and the NodeList was properly created and placed in the variable. Can someone tell me why thm is being returned undefined? querySlectorProblem by FutureWebDev, on Flickr I'm interested to see how many of our users have JavaScript enabled. My idea is to set a cookie using JS and read it back on a subsequent page load via PHP, log this in a database or flatfile and get an idea of how many users are using JS, and correlate that with their browser version. Of course we have AWStats that we can refer to, but it doesn't give an idea of what percentage of users have JS enabled. Comments? Ideas? Has anyone done this successfully and what was the result? Hello, I'm trying to write my class with member properties and functions like below. What I want to learn is that is there any problem to use prototype object in the class that we want to use with it? I asked because I generally see that prototype object definition and member functions and properties created outside of the class unlike my class that I wrote like below. Is there any problem writing my class like below? Thanks. Code: function Point() { Point.prototype.x = this._x; Point.prototype.y = this._y; function _setX(x) { this.x = x; } Point.prototype.setX = _setX; function _setY(y) { this.y = y; } Point.prototype.setY = _setY; function _show() { alert(this.x + this.y); } Point.prototype.Show = _show; } function callMyClass() { var p = new Point(); p.setX(3); p.setY(5); p.Show(); } Hello, I am trying to parse a string using regular expressions. This string can potentially have any number of non-alphanumeric characters acting as delimiters. These delimiters can also be grouped together. Here are some examples of the data: 00923:5342:123 --> I want to extract 00923, 5342 and 123 into an array 08765::764375 --> parse this as 08765 and 764375 into an array 3246//672354//23458 --> parse as 3246, 672354 and 23458 23564-73654 --> etc I'm using the following code: Code: var ids = str.match(/\w*/g); But it just returns the first token from each line and ignores the rest. So with the above data I'm only getting back 00923, 08765, 3246 and 23564 into the first element of the "ids" array. I've also tried an "inverse" approach using the split method like so: Code: var ids = str.split(/\W*/g); and I just get the same result - the first token from each line is only returned. My test code looks like this ('str' contains a string read in from a file): Code: var ids = str.match(/\w*/g); //var ids = str.split(/\W*/g); task.logmsg("the length of the array is " + ids.length); for (i = 0; i < ids.length; i++) { task.logmsg("ids=[" + i + "]=" + ids[i]); } I can confirm that ids.length is returning 1 (??) The 'task' object comes from a separate library and the 'logmsg' method just writes to the console. My reptilian brain is struggling with reg exps. This shouldn't be difficult to do, but I just can't get it to work. If anyone out there can lend some assistance, it would be greatly appreciated. Thanks, JD Hi, I have a programing problem that have been around for ages. I have search on google using several expressions and words and after hours of digging i'm still unable to do it. I would like to get a value from a HTML page hosted remotely with an inconstant value. Then define this value and name as a javascript variable and apply or show in my page. Thanks for all the help P.S. Is there any way to make a domain lookup in javascript? I mean a user enters a domain and the script converts to an ip and shows to the user. If not thanks, probably it can only be done in the server side... Hello I have a php page in which I declared a js variable... right at the top of the page... <script type="text/javascript"> var tester = 0; </script> Later in the page I test this variable... <script type="text/javascript"> if (tester==1){ do some stuff!! } </script> But I keep getting an error variable _tester undefined Am I missing something obvious... I am new to js... but this seems really straightforward I don't know how I should do ? Quote: <html> <head> <script type="text/javascript"> function add(a,b){ y=a+b return y } var aaa = add(one,two) //one needs to get somehow get the value of yil, in this case 10 var one = function reas(){i=10;if(i<10){yil = 15}; else{yil = 10; yil = one;}; var two = 20; document.write(y) </script> </head> </html> also why doesn't this work? Quote: <html> <head> <script type="text/javascript"> function adder(a,b){ var k=a+b; return k } var hes=adder(5,kol); kol=40; alert(hes); </script> </head> </html> you cannot have variables in callback functions? Hi! I have a javascript in the head of the document which has a variable named "ref2" ... ref2 is already working as I can see its value working in another function. I need to send this variable as the value of a hidden field in the form which is in the body of the document. This is my JavaScript Code: Code: function WriteContactFormStatement1 () { var ContactFormValue = ref2; document.write('<input type="hidden" name="UReferrersName" value="' + ContactFormValue + '" />'); } var WriteContactFormStatement = WriteContactFormStatement1 (); And at the end of my form, before the submit button, I have the following code: Code: <!-- START -- Javascript to print the statement for UReferrersName --> <script language="JavaScript" type="text/JavaScript"> //WriteContactFormStatement(); document.write (WriteContactFormStatement); </script> <!-- End -- Javascript to print the statement for UReferrersName --> When I execute the form, it doesn't work the way it should, plus, gives me a word "undefined" next to the "Submit" button ..... Please help !... - Xeirus. If I manually write out "2/22/2012 4:00 PM" in TargetDate, I get the correct result for what I want to do (a countdown). But I want the countdown to always be the current day at 4pm. So I tried the code below thats commented, but it is not working. New to javascript, still reading the books, just hoping for some guidance on this. Code: Next Update: <script language="JavaScript"> var currentTime = new Date() var month = currentTime.getMonth() + 1 var day = currentTime.getDate() var year = currentTime.getFullYear() TargetDate = "2/22/2012 4:00 PM"; //TargetDate = "document.write(month + "/" + day + "/" + year) + 4:00PM"; BackColor = "white"; ForeColor = "red"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%H%% H, %%M%% M, %%S%% S"; FinishMessage = "Forecasts posted"; </script> <script language="JavaScript" src="countdown.js"></script> Hello everybody I have a problem with Java Script damned I want to add the values of several variables in one variable and then use this variable, which contains the values of variables You can see the following example HTML Code PHP Code: <input type="text" name="txt1" /> <br/>age <input type="text" name="txt2" /> <br/><br/> <input type="button" name="submits" value="send"/> Javascript Code PHP Code: field = document.getElementsByName('txt1')[0]; field2 = document.getElementsByName('txt2')[0]; submit = document.getElementsByName('submits')[0]; data = 'data=' + field.value + '&data2=' + field2.value + '&submits=' + submit.value; document.getElementsByName('submits')[0].onclick = function(){ alert(data); } After executing this code I find that the variables are not displayed values As in the following picture I want to know what the cause of this problem ? Hello I have a piece of javascrip that refreshes the page: ---------- Code: <script type="text/javascript"> <!-- Begin function reFresh() { location.reload(true) } /* Set the number below to the amount of delay, in milliseconds, you want between page reloads: 1 minute = 60000 milliseconds. 2 minutes = 120000 milliseconds 5 minutes = 300000 milliseconds*/ window.setInterval("reFresh()",20000); // End --> </script> -------- I am new to javascript and wanted to use an html options menu in order to be able to choose the refresh interval: Code: <SELECT NAME="refreshtime"> <OPTION VALUE="60000">1 min</option> <OPTION VALUE="120000">2 min</option> <OPTION VALUE="180000">3 min</option> <OPTION VALUE="240000">4 min</option> </SELECT> I know that I have to pass a variable to the function. I have tried several variations but none have worked. I have mostly received a "done with errors" warning. Any help would be appreciated. Thanks Zam This might be a stupid question, but is there any memory usage difference between var variable1, variable2; and var variable1; var variable2;? I'm learning how to use faster code hence the question.
Hi, I want to write some javascript code that uses arrays, I have a list of arrays named array1, array2, array3 etc. I want to perform a function on each of these arrays. I wanted to have a variable for the number after array so this is what I have: <code> var array1 = new Array ("1","2","3","4","5"); var array2 = new Array ("5","6","7","8","9"); for (var i=1; i<=2;i++){ document.writeln(("array"+i)[1]); } </code> the problem is it gives me the letters in the string array instead of the array values. How do I get javascript to treat ("array"+i) as array1? Can anyone tell me of how to take or assign a javascript variable into php.
hello How I Can make var in var like in php: PHP Code: $variable = "$var_to_get" i need to do that job in java , if possible am sorry CoZ my English not good ^_* I have a form created in Dreamweaver that uses the following code to validate the form: Code: function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_validateForm() { //v4.0 var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } In the form: Code: onsubmit="MM_validateForm('FirstName','','R','LastName','','R','Address1','','R','HomePhone','','R','email','' ,'RisEmail');return document.MM_returnValue"> I have a second form that I want to submit after the first form is submitted and am using the following: Code: function SubmitForm(){ document.paypal.submit(); } My question: I don't know javascript. Is there a variable I can add to the function MM_validateForm() so that if the first form does not validate, the second form will not be sent? Thanks in advance for any help. I'm trying to store the name of an element ID into a variable, because i need to use it in the second branch of the If-then code. The problem is, when i use: var FirstPiece = e.id alert(FirstPiece); it works, but, when i try to access the data that should still be stored in the FirstPiece variable in the second branch of the If-then structure, i get an error: "undefined". This makes no sense at all to me, because the Scope of the variable is within the function, so it should have access. But for some reason it doesn't. Am i doing something wrong? The code snippet in question: Code: // Set the PieceSelected Flag if (PieceSelectedFlag == 0) { // First Piece Selected var FirstPiece = e.id; PieceSelectedFlag++ return; } if (PieceSelectedFlag == 1) { // Move the piece //document.getElementById(Move).style.left = NewXpos; //document.getElementById(Move).style.top = NewYpos; alert(FirstPiece); // Record the PGN data // Reset the flags and visibilities document.getElementById("PieceBorder").style.visibility = "hidden"; PieceSelectedFlag = 0; MoveFrom = ""; MoveTo = ""; } Full Code: Code: <html> <body> <head> <script lanugage="javascript"> var BlockSize = 50; var BlockBorderWidth = 4; var PieceSelectedFlag = 0; // Create an Array for storing the Positions of the ChessPieces var PieceLocationName = [32]; var PieceLocationXcoord = [32]; var PieceLocationYcoord = [32]; function Start() { // Draw a 400x200 Canvas starting at the bottom of the Chess Board with // White as color on top, and black underneith it //DrawCanvas(0, 500, 400, 200); // Init the Height and Width of the Chess Piece Highlighter border DIV document.getElementById("PieceBorder").style.height = BlockSize -BlockBorderWidth; document.getElementById("PieceBorder").style.width = BlockSize - BlockBorderWidth; // Resize the Chess Piece Images to the appropriate size AdjustPieceSize(BlockSize); // Put the Chess Pieces in their correct places SetPieces(); } function SetPieces() { var LocationArrayIndex = 0; var Pieces = ["Castle1", "Knight1", "Rook1", "King", "Queen", "Rook2", "Knight2", "Castle2"]; // Put down the Black Pieces On the Top var PieceIndex = 0; var PawnIndex = 1; for (var x = 0; x < BlockSize * 8; x=x+BlockSize) { var y = 0; SetPieceID = "Black" + Pieces[PieceIndex] + "Image"; document.getElementById(SetPieceID).style.left = x + "px"; // Set the Chess Piece in the correct place document.getElementById(SetPieceID).style.top = y + "px"; // Load the Piece Name and Location into the PieceLocation Array PieceLocationName[LocationArrayIndex] = SetPieceID; PieceLocationXcoord[LocationArrayIndex] = x; PieceLocationYcoord[LocationArrayIndex] = y; LocationArrayIndex++ document.getElementById("BlackPawn" + PawnIndex + "Image").style.left = x + "px"; // Also set down the pawns document.getElementById("BlackPawn" + PawnIndex + "Image").style.top = y + BlockSize + "px"; // Load the Pawn Name and Location into the PieceLocation Array PieceLocationName[LocationArrayIndex] = SetPieceID; PieceLocationXcoord[LocationArrayIndex] = x; PieceLocationYcoord[LocationArrayIndex] = y; PieceIndex++; PawnIndex++; LocationArrayIndex++ } // now put down the white pieces PieceIndex = 0; PawnIndex = 1; for (var x = 0; x < BlockSize * 8; x=x+BlockSize) { var y = BlockSize * 7; SetPieceID = "White" + Pieces[PieceIndex] + "Image"; document.getElementById(SetPieceID).style.left = x + "px"; // Set the Chess Piece in the correct place document.getElementById(SetPieceID).style.top = y + "px"; // Load the Piece Name and Location into the PieceLocation Array PieceLocationName[LocationArrayIndex] = SetPieceID; PieceLocationXcoord[LocationArrayIndex] = x; PieceLocationYcoord[LocationArrayIndex] = y; LocationArrayIndex++ document.getElementById("WhitePawn" + PawnIndex + "Image").style.left = x + "px"; // Also set down the pawns document.getElementById("WhitePawn" + PawnIndex + "Image").style.top = y - BlockSize + "px"; // Load the Pawn Name and Location into the PieceLocation Array PieceLocationName[LocationArrayIndex] = SetPieceID; PieceLocationXcoord[LocationArrayIndex] = x; PieceLocationYcoord[LocationArrayIndex] = y; PieceIndex++; PawnIndex++; LocationArrayIndex++ } } function AdjustPieceSize(NewSize) { // Adjust the size of the Chess pieces var ColorPiece = ["White", "Black"]; var PieceName = ["Pawn1", "Pawn2", "Pawn3", "Pawn4", "Pawn5", "Pawn6", "Pawn7", "Pawn8", "Castle1", "Castle2", "Knight1", "Knight2", "Rook1", "Rook2", "King", "Queen"]; for (var ColorIndex = 0; ColorIndex < ColorPiece.length; ColorIndex++) { for (var PieceIndex = 0; PieceIndex < PieceName.length; PieceIndex++) { var String = ColorPiece[ColorIndex] + PieceName[PieceIndex] + "Image"; document.getElementById( String ).style.width = NewSize; document.getElementById( String ).style.height = NewSize; } } } function RoundNearest(num, acc) { if ( acc < 0 ) { // alert("warning!"); // return; num *= acc; num = Math.round(num); num /= acc; return num; } num /= acc; num = Math.floor(num); num *= acc; return num; } function SelectChessLocation(e, event) { // Get the current mouse x,y position var xCoord = event.clientX; var yCoord = event.clientY; // What is the closest Square var ClosestX = RoundNearest(xCoord, BlockSize); var ClosestY = RoundNearest(yCoord, BlockSize); // Draw a Red Border around the closest square document.getElementById("PieceBorder").style.visibility = "visible"; document.getElementById("PieceBorder").style.top = ClosestY; document.getElementById("PieceBorder").style.left = ClosestX; // Set the PieceSelected Flag if (PieceSelectedFlag == 0) { // First Piece Selected var FirstPiece = e.id; PieceSelectedFlag++ return; } if (PieceSelectedFlag == 1) { // Move the piece //document.getElementById(Move).style.left = NewXpos; //document.getElementById(Move).style.top = NewYpos; alert(FirstPiece); // Record the PGN data // Reset the flags and visibilities document.getElementById("PieceBorder").style.visibility = "hidden"; PieceSelectedFlag = 0; MoveFrom = ""; MoveTo = ""; } } </script> </head> <body bgColor="green" onLoad="Start();"> <img id="ChessBoard" src="ChessBoard.png" style="position: absolute; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn1Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn2Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn3Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn4Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn5Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn6Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn7Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackPawn8Image" src="Black-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackCastle1Image" src="Black-Castle.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackKnight1Image" src="Black-Knight.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackRook1Image" src="Black-Rook.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackKingImage" src="Black-King.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackQueenImage" src="Black-Queen.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackRook2Image" src="Black-Rook.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackKnight2Image" src="Black-Knight.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="BlackCastle2Image" src="Black-Castle.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn1Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;"OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn2Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn3Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn4Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn5Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn6Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn7Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhitePawn8Image" src="White-Pawn.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteCastle1Image" src="White-Castle.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteKnight1Image" src="White-Knight.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteRook1Image" src="White-Rook.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteKingImage" src="White-King.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteQueenImage" src="White-Queen.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteRook2Image" src="White-Rook.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteKnight2Image" src="White-Knight.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <img id="WhiteCastle2Image" src="White-Castle.png" style="position:absolute; width: 50px; height: 50px; top: 0px; left: 0px;" OnClick="SelectChessLocation(this, event);"> <div id="PieceBorder" Style="position: absolute; top: 0px; left: 0px; height: 50px; width: 50px; border: 2px solid red; visibility: hidden;"> </div> </body> </html> |