Avatar of thtate
thtateFlag for United States of America

asked on 

need to read the contents of custom meta tag using only vbscript asp

Hi!

I have ASP web pages that have a custom meta tag. I am using an include to read the value of that tag and place it into a variable.

I previously used a javascript to do it, using:
someVariable =  document.getElementsByTagName('nameofcustomtag').content;

Now I need to replace it with a classic ASP VBScript equivalent. To clarify, I already tried essentially the same code using ASP and got the following error:

   Microsoft VBScript runtime  error '800a01a8'
   Object required: 'document'

Thanks in advance for the help!
ASPHTML

Avatar of undefined
Last Comment
b0lsc0tt
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

thtate,

The document reference doesn't mean anything because that is part of the DOM and client side.  ASP is run on the server.

How does ASP write that tag and part of the page?  Do you have to get the info on the same script page?  Unless the ASP script stores that part of the html in some ASP variable there is no way for the same script/page to get that info.  Another ASP page could "read" the html and get it with something like ASPTear or the Server.XMLHTTP object.

Let me know a little more about which script page and when and we might find a way to do this.  However I am afraid you will be out of luck.  Let me know if you have any questions or need more information.

b0lsc0tt
Avatar of thtate
thtate
Flag of United States of America image

ASKER

The custom meta tag is placed manually on each page. It doesn't exist in any other ASP variable or datasource. So I'm guessing the thing to do is place the page (or preferably just the ) into a variable and then search the variable for that particular meta tag and its value?
Avatar of thtate
thtate
Flag of United States of America image

ASKER

Alternately, are there other ways / tools to access the HTML DOM from a server-side script?
ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

I'm glad I could help.  Thanks for the grade, the points and the fun question.
bol
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo