Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #11529 > unrolled thread

Get attribute from HTA

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2012-02-10 11:25 +1100
Last post2012-02-11 23:33 +0000
Articles 5 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  Get attribute from HTA Andrew Poulos <ap_prog@hotmail.com> - 2012-02-10 11:25 +1100
    Re: Get attribute from HTA Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-10 03:02 +0100
      Re: Get attribute from HTA Andrew Poulos <ap_prog@hotmail.com> - 2012-02-10 18:51 +1100
        Re: Get attribute from HTA Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-10 10:40 +0100
    Re: Get attribute from HTA Dr J R Stockton <reply1206@merlyn.demon.co.uk> - 2012-02-11 23:33 +0000

#11529 — Get attribute from HTA

FromAndrew Poulos <ap_prog@hotmail.com>
Date2012-02-10 11:25 +1100
SubjectGet attribute from HTA
Message-ID<-uOdnYr0A5Wf-anSnZ2dnUVZ_rSdnZ2d@westnet.com.au>
If I have this in the head of a HTA

<HTA:APPLICATION
   id="test"
   applicationname="Test"
   icon="content/scripts/test.ico"
   border="thick"
   borderStyle="normal"
   caption="yes"
   contextMenu="no"
   navigable="yes"
   scroll="yes"
   selection="no"
   showInTaskbar="yes"
   singleInstance="yes"
   windowState="normal">

How do I get the value of 'scroll'?

I tried
document.getElementsByTagName("HTA")
and
document.getElementsByTagName("HTA:APPLICATION")
but both return 0 elements.

When I stripped everything from the Head except for the HTA then

document.getElementsByTagName("head")[0].getElementsByTagName("*").length

returns 3.

document.getElementsByTagName("head")[0].getElementsByTagName("*")[0].tagName

returns TITLE

document.getElementsByTagName("head")[0].getElementsByTagName("*")[1].tagName

returns !

document.getElementsByTagName("head")[0].getElementsByTagName("*")[2].tagName

returns APPLICATION

The answer appears to be, in my case,

document.getElementsByTagName("head")[0].getElementsByTagName("APPLICATION")[0].scroll

Andrew Poulos

[toc] | [next] | [standalone]


#11530

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-02-10 03:02 +0100
Message-ID<1371529.bfuUreu131@PointedEars.de>
In reply to#11529
Andrew Poulos wrote:

> If I have this in the head of a HTA
> 
> <HTA:APPLICATION
>    id="test"
>    applicationname="Test"
>    icon="content/scripts/test.ico"
>    border="thick"
>    borderStyle="normal"
>    caption="yes"
>    contextMenu="no"
>    navigable="yes"
>    scroll="yes"
>    selection="no"
>    showInTaskbar="yes"
>    singleInstance="yes"
>    windowState="normal">
> 
> How do I get the value of 'scroll'?
> 
> I tried
> document.getElementsByTagName("HTA")

This cannot work.  `HTA' is the namespace prefix, not the element type name.  
Please get a minimum clue.

> and document.getElementsByTagName("HTA:APPLICATION")
> 
> but both return 0 elements.

Tough luck.

document.getElementsByTagName("APPLICATION") should work as it also works in 
MSXML.
 
> The answer appears to be, in my case,
> 
> document.getElementsByTagName("head")
[0].getElementsByTagName("APPLICATION")[0].scroll

Why oh why on Earth are you asking, then?

RTFM: <http://msdn.microsoft.com/en-us/library/ms536476(VS.85).aspx>


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#11536

FromAndrew Poulos <ap_prog@hotmail.com>
Date2012-02-10 18:51 +1100
Message-ID<89ednbWlvLntUanSnZ2dnUVZ_gydnZ2d@westnet.com.au>
In reply to#11530
On 10/02/2012 1:02 PM, Thomas 'PointedEars' Lahn wrote:
> Andrew Poulos wrote:
>
>> If I have this in the head of a HTA
>>
>> <HTA:APPLICATION
>>     id="test"
>>     applicationname="Test"
>>     icon="content/scripts/test.ico"
>>     border="thick"
>>     borderStyle="normal"
>>     caption="yes"
>>     contextMenu="no"
>>     navigable="yes"
>>     scroll="yes"
>>     selection="no"
>>     showInTaskbar="yes"
>>     singleInstance="yes"
>>     windowState="normal">
>>
>> How do I get the value of 'scroll'?
>>
>> I tried
>> document.getElementsByTagName("HTA")
>
> This cannot work.  `HTA' is the namespace prefix, not the element type name.
> Please get a minimum clue.

I wish I knew a couple of percent of what you know :-(

>> and document.getElementsByTagName("HTA:APPLICATION")
>>
>> but both return 0 elements.
>
> Tough luck.
>
> document.getElementsByTagName("APPLICATION") should work as it also works in
> MSXML.
>
>> The answer appears to be, in my case,
>>
>> document.getElementsByTagName("head")
> [0].getElementsByTagName("APPLICATION")[0].scroll
>
> Why oh why on Earth are you asking, then?

I was sharing what I thought was difficult-to-find info.

> RTFM:<http://msdn.microsoft.com/en-us/library/ms536476(VS.85).aspx>

Far out, how do you find all these references. I googled and searched 
MSDN and couldn't find it.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#11544

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-02-10 10:40 +0100
Message-ID<1336691.W6u1xrnRel@PointedEars.de>
In reply to#11536
Andrew Poulos wrote:

> On 10/02/2012 1:02 PM, Thomas 'PointedEars' Lahn wrote:
>> Andrew Poulos wrote:
>>> If I have this in the head of a HTA
>>>
>>> <HTA:APPLICATION
>>>     id="test"
>>>     applicationname="Test"
>>>     icon="content/scripts/test.ico"
>>>     border="thick"
>>>     borderStyle="normal"
>>>     caption="yes"
>>>     contextMenu="no"
>>>     navigable="yes"
>>>     scroll="yes"
>>>     selection="no"
>>>     showInTaskbar="yes"
>>>     singleInstance="yes"
>>>     windowState="normal">
>>>
>>> How do I get the value of 'scroll'?
>>>
>>> I tried
>>> document.getElementsByTagName("HTA")
>>
>> This cannot work.  `HTA' is the namespace prefix, not the element type
>> name. Please get a minimum clue.
> 
> I wish I knew a couple of percent of what you know :-(

Only comes with experience.  My assumption was that if I see a start tag 
where the first part has a colon in it, that is referring to XML namespaces:

<http://www.w3.org/TR/REC-xml-names/>

>>> and document.getElementsByTagName("HTA:APPLICATION")
>>>
>>> but both return 0 elements.
>>
>> Tough luck.
>>
>> document.getElementsByTagName("APPLICATION") should work as it also works
>> in MSXML.

Correction: "HTA:APPLICATION" might have worked as well.  Because MSXML does 
not appear to be *fully* namespace-aware.  I found that out when writing 
JSX:xpath.js and I had to trim the namespace prefix for the XPath expression 
with *user-defined* prefixes to work in Internet Explorer:

<http://PointedEars.de/websvn/filedetails.php?repname=JSX&path=/trunk/xpath.js>

(No line numbers yet; look for `else if (isMethod(contextNode, 
"selectNodes"))'.)

>>> The answer appears to be, in my case,
>>>
>>> document.getElementsByTagName("head")
>> [0].getElementsByTagName("APPLICATION")[0].scroll
>>
>> Why oh why on Earth are you asking, then?
> 
> I was sharing what I thought was difficult-to-find info.

ACK.

>> RTFM:<http://msdn.microsoft.com/en-us/library/ms536476(VS.85).aspx>
> 
> Far out, how do you find all these references. I googled and searched
> MSDN and couldn't find it.

I googled "HTA", which after a few not so useful links to "*H*ochschule 
Luzern - *T*echnik & *A*rchitektur" lead me to the German Wikipedia article 
[1], in which was a link to the MSDN Library as the first one in the section 
"Weblinks" [2].  Then as I saw that despite the German-language interface 
the referred content was in English, so I tried "en-us" instead of "de-de".  
This worked.  Then I clicked on "border", and there it is.


HTH

PointedEars
______
[1] <http://de.wikipedia.org/wiki/HTML-Applikation>
[2] <http://msdn.microsoft.com/de-de/library/ms536471(en-us,VS.85).aspx>
-- 
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

[toc] | [prev] | [next] | [standalone]


#11713

FromDr J R Stockton <reply1206@merlyn.demon.co.uk>
Date2012-02-11 23:33 +0000
Message-ID<KOdNqtM6qvNPFwfp@invalid.uk.co.demon.merlyn.invalid>
In reply to#11529
In comp.lang.javascript message <-uOdnYr0A5Wf-anSnZ2dnUVZ_rSdnZ2d@westne
t.com.au>, Fri, 10 Feb 2012 11:25:29, Andrew Poulos
<ap_prog@hotmail.com> posted:

>If I have this in the head of a HTA
>
><HTA:APPLICATION
>  id="test"
>  applicationname="Test"
>  icon="content/scripts/test.ico"
>  border="thick"
>  borderStyle="normal"
>  caption="yes"
>  contextMenu="no"
>  navigable="yes"
>  scroll="yes"
>  selection="no"
>  showInTaskbar="yes"
>  singleInstance="yes"
>  windowState="normal">
>
>How do I get the value of 'scroll'?
>

See in <http://www.merlyn.demon.co.uk/programs/32-bit/seek.hta>, usong a
non-IE browser, for how I do similar :

        <hta:application
          ID="oHTA"
          applicationname="SEEK"
          version="1.0">

          var S = oHTA.commandLine

so I think   var X = test.scroll would do for you.

Also, see (any browser)
<http://www.merlyn.demon.co.uk/programs/32-bit/seakfyle.htm> for links
to information (references section).

While there. test SEEK/SEAKFYLE !

-- 
 (c) John Stockton, nr London UK  ?@merlyn.demon.co.uk  IE8 FF8 Op11 Sf5 Cr15
   news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>.
   <http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
   <http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web