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

adding a debug alert function

132 100+
Hi,

I'm working on a script and for debugging I want to check what values are in my array.

Now instead of putting alerts everywhere in the code I wanted to put an inputbox with an alertbutton. This way if I want to see what's in the array, I could just type in for example: items[1].name and press the alert button and I would get an alert-button saying what the name is.

So far for theory.

So what I'm trying to do is alert(items[i].name) but where I can fill in what I want to see.

Right now when I type in item[i].name and press the alertbutton, I get an alert saying item[i].name where I actually want to see what's in items[1].name

I know it's gonna be something simple but for a very peculiar reason I can build scripts that can perform the most challenging tasks but I always get stuck on those little stupid things and that's when I turn to the real experts :-)
Nov 10 '08 #1
1 1196
acoder
16,027 Expert Mod 8TB
You can use the window object, e.g. window[val] where val would be the name input into the text box.
Nov 10 '08 #2

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

Similar topics

15
by: Stormkid | last post by:
Hey Gang, I'm trying to figure out the best way to add two times together of the format hh:mm:ss any suggestions would be great thanks Todd
20
by: David | last post by:
I have a one-line script to add an onunload event handler to the body of the document. The script is as follows: document.getElementsByTagName("BODY").onunload=function s() {alert("s")} Now...
4
by: domas | last post by:
Hi, I can't get my semi-dynamic form to work. Maybe you could help. I've got a simple form with a select box. And a button that, when clicked, creates another copy if the select box and places...
7
by: annoyingmouse | last post by:
Is it possible to use javascript to add javascript to a DOM object? I've the following code to add an image to a page: function flagError(id){ var image = document.createElement('img');...
13
by: Lee | last post by:
I have this function that doesn't work. I pass it the td element and an id, and it makes an input field inside the td. That part workds. What doesn't work is that I want to add an "onkeyup" on...
1
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this...
3
by: Tarik Monem | last post by:
Hey everyone, I'm trying to add javascript tags into a specific DIV so that I can use a variable to change out the script tags source and use it as a type of "javascript-include" I found a...
2
by: abhimanyu singh | last post by:
i m facing a serious probs now a days............ its seems easy but for me i found it difficult......... i want to do transformation usig xsl and xml(adding parameter). for IE its working fine...
18
omerbutt
by: omerbutt | last post by:
AJAX PROB WITH MULTIPLE RECORDS helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.