Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript variable

Status
Not open for further replies.

contiw

Programmer
Jun 28, 2002
25
US
Hello!

I have this var
myVar=new Date(2003,2,12,17,18,12);

alert(myVar)
returns "Wed Mar 12 17:18:12 PST 2003"

Is it possble to get the literal string
"new Date(2003,2,12,17,18,12)"
instead of the formed date?

All the best.

 
try
myVar=new String(2003,2,12,17,18,12); _________________________________________________________
for the best results to your questions: FAQ333-2924
01001111 01101110 01110000 01101110 01110100
onpnt2.gif
[/sub]
 
whoops! surounded it quotes
myVar=new String("2003,2,12,17,18,12"); _________________________________________________________
for the best results to your questions: FAQ333-2924
01001111 01101110 01110000 01101110 01110100
onpnt2.gif
[/sub]
 
myVar is actually an array element tranformed for semplicity, and it comes from a chunk of XML code which
comes from a database query. Cannot touch that.
 
Can someone please provide an example of how to achieve this...I have an XML file:

----------------------
<?xml version=&quot;1.0&quot;?>
<top>
<Process>
<Location>\\test_machine\test</Location>
<Gauge>LOG</Gauge>
<Filter>10</Filter>
</Process>
<Process>
<Filter>45</Filter>
<Location>\\test_machine\again</Location>
<Gauge>TXT</Gauge>
</Process>
<Process>
<Location>\\test_machine\more</Location>
<Gauge>HKE</Gauge>
<Filter>20</Filter>
</Process>
<Process>
<Location>\\test_machine\one</Location>
<Gauge>LTX</Gauge>
<Filter>999</Filter>
</Process>
</top>
-------------------
How would I do this if I wanted something on the &quot;Process&quot; line, for example:

<Process Name=&quot;This test&quot;>
<Location>\\test_machine\one</Location>
<Gauge>LTX</Gauge>
<Filter>999</Filter>
</Process>

I can already get the Location, Gauge and Filter to work bu I want to be able to identify the Parent value too.

Now, when I process I want to display the &quot;This test&quot; on the &quot;Process&quot; node. I am using JavaScript (JScript) on Windows Scripting Host and the MS DOM object.

Can that be done? If so, can you provide some an example on that?

Any assistance would greatly be appreciated.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top