473,396 Members | 1,678 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,396 software developers and data experts.

Cannot get my variable to display the value?

4
I am taking a course of which Javascript is part. I don't necessairly want an answer but if someone could point me in the right direction I would appreciate it I have to create a 16x16 table that shows the first 256 character entities with the entity number and corresponding symbol for each. When the script outputs to the browser it does not show the number. It show 'k' for everything. Where should I look? Thanks.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. k=1;
  3. document.write("<table>");
  4. for (i = 1; i <= 16; i++) {
  5. document.write("<tr>");
  6.     for (j = 1; j <= 16; j++) {
  7. document.write("<td> <center>k <br /> &#k;</center> </td>");
  8. k++
  9. }
  10. document.write("</tr>");
  11. }
  12. document.write("</table>");
  13. </script>
Jan 28 '08 #1
6 1605
Ixnay
4
I am taking a course of which Javascript is part. I don't necessairly want an answer but if someone could point me in the right direction I would appreciate it I have to create a 16x16 table that shows the first 256 character entities with the entity number and corresponding symbol for each. When the script outputs to the browser it does not show the number. It show 'k' for everything. Where should I look? Thanks.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. k=1;
  3. document.write("<table>");
  4. for (i = 1; i <= 16; i++) {
  5. document.write("<tr>");
  6. for (j = 1; j <= 16; j++) {
  7. document.write("<td> <center>k <br /> &#k;</center> </td>");
  8. k++
  9. }
  10. document.write("</tr>");
  11. }
  12. document.write("</table>");
  13. </script>
Jan 28 '08 #2
BigDaddyLH
1,216 Expert 1GB
Moved from Java to JavaScript forum. Java is not JavaScript. Good luck in your JavaScript course.

--MODERATOR
Jan 28 '08 #3
Ixnay
4
Thanks, I realized that after I posted it.

Moved from Java to JavaScript forum. Java is not JavaScript. Good luck in your JavaScript course.

--MODERATOR
Jan 28 '08 #4
I hope this will work for you .It seems to me that you were not concatenating the string correctly.


Expand|Select|Wrap|Line Numbers
  1.         <script type="text/javascript">
  2.                           k=1;
  3.                          document.write("<table>");
  4.                           for (i = 1; i <= 16; i++) {
  5.                                document.write("<tr>");
  6.                                        for (j = 1; j <= 16; j++) {
  7.                                             document.write("<td> <center>k <br /> "+k+";</center> </td>");
  8. k++
  9. }
  10.                              document.write("</tr>");
  11. }
  12.                        document.write("</table>");
  13.              </script>
Jan 28 '08 #5
gits
5,390 Expert Mod 4TB
threads merged ...

kind regards
MODERATOR
Jan 28 '08 #6
Ixnay
4
Thank you very much. I was able to take that and make the rest of it work. I was close but just couldn;t find that last piece.
Jan 28 '08 #7

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

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
15
by: Charles Law | last post by:
I have adapted the following code from the MSDN help for PropertyInfo SetValue. In the original code, the structure MyStructure is defined as a class MyProperty, and it works as expected. There is...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
0
by: bonita | last post by:
In my ASP.NET page, I have 2 checkboxes for users to choose which crystal report they want to display. These two reports use different tables. If report1 has been choosen and displayed in the...
29
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
2
by: assgar | last post by:
I am having problems getting the user selected form info to inserted into the mysql database. I am also rec eving an error: Warning: Variable passed to each() is not an array or object in ...
4
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my...
3
by: Abhinavnaresh | last post by:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ...
1
by: Radu | last post by:
Hi. I am trying to localize a page AND simulate the AJAX watermarks in it, i.e. the textbox contains the text "Enter your name", or "Entrez votre nom", for instance, then on click, delete this...
1
by: faultykid | last post by:
I would like to store a variable then call it back later. I have a variable on line 198 www = ''+this._ad.clickUrl+''; and on line 321 i try document.write(www);
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.