Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get attribute from HTA

93 views
Skip to first unread message

Andrew Poulos

unread,
Feb 9, 2012, 7:25:29 PM2/9/12
to
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

Thomas 'PointedEars' Lahn

unread,
Feb 9, 2012, 9:02:04 PM2/9/12
to
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

Andrew Poulos

unread,
Feb 10, 2012, 2:51:03 AM2/10/12
to
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

Thomas 'PointedEars' Lahn

unread,
Feb 10, 2012, 4:40:06 AM2/10/12
to
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.)

Dr J R Stockton

unread,
Feb 11, 2012, 6:33:14 PM2/11/12
to
In comp.lang.javascript message <-uOdnYr0A5Wf-anSnZ2dnUVZ_rSdnZ2d@westne
t.com.au>, Fri, 10 Feb 2012 11:25:29, Andrew Poulos
<ap_...@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.
0 new messages