473,324 Members | 2,356 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,324 software developers and data experts.

Modify Meta Tag with JavaScript

Jim
Is there a way to modify a meta tag's content in javascript? Any
examples would be appreciated. Thanks

Jul 23 '05 #1
1 16075


Jim wrote:
Is there a way to modify a meta tag's content in javascript?


Browsers that support getElementsByTagName will allow you access to
elements by the tag name (e.g. 'meta') and then the HTMLMetaElement
object implements
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-37041454>

var meta;
if (document.getElementsByTagName) {
meta = document.getElementsByTagName('meta')[0];
if (meta) {
meta.name = 'Author';
meta.content = 'Kibo';
}
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jim Bond | last post by:
Hello, I have found myself in the position of having to manage & "hack" a web site built by someone else. I am trying to make a modification to the javascript code and have been unable to get...
1
by: Luca Giannoni | last post by:
Hello everybody, I have this problem: I have a file javascript xxx.js that I include in my asp page as <SCRIPT SRC="scripts/xxx.js"> It's possible to modify content of xxx.js at runtime... I...
5
by: Peter | last post by:
I have the following code that executes JavaScript, is there a way I can put the same JavaScript code in it's own file and execute the code in that file instead of having this JavaScript code in my...
5
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get my browser to report javascript errors?...
5
Frinavale
by: Frinavale | last post by:
I have a slight problem with a Tab Control that I've developed for an application. Once sent to the browser it runs via JavaScript. The JavaScript is dynamically generated by my .NET code. ...
3
by: NobodyImportant | last post by:
Hello everyone! I admit up front that I am new at this and have very little knowledge of JavaScript, but we have an asp web form that allows for the manipulation of letters our company regularly...
28
Frinavale
by: Frinavale | last post by:
Call me crazy because I'm basically trying to re-invent the wheel here but I learn from doing things the hard way....and the sales guys want the site to look consistant. I'm attempting to create...
7
by: Ryan Peters | last post by:
Our application uses JavaScript to show/hide buttons and div's that provide information for a user based on their security level. Their level is determined from a database query that is done in...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.