PDA

View Full Version : Setting META Keywords using Spry


Reverend2010
04-30-2010, 11:41 AM
Hi all

My first post so please be gentle...

I've manage to set my HTML page-title using external XML with this code:

<script type="text/javascript">
var dsHomepage = new Spry.Data.XMLDataSet("home.xml", "HomePage/title");
</script>

<script src="Scripts/gallery.js" type="text/javascript"></script>
<script type="text/javascript">
dsHomepage.addObserver({
onPostLoad:function(ds, data){
var row = ds.getCurrentRow();
document.title = row.title;
}
});

and this XML:
<?xml version='1.0' encoding='UTF-8'?>
<HomePage>
<title>My Page Title</title>
</HomePage>

...and it works great. However, I would like to know if it's possible to set the KEYWORDS (or any META data) using XML too?

And if so, can someone please show me how!

Thanks in anticipation :)

Reverend2010
05-04-2010, 11:43 AM
anyone?

...Is this a good forum to post in or is there a better one somewhere?

edbr
05-05-2010, 10:19 AM
sorry not sure what you are trying to achieve here , can you elaborate?

Reverend2010
05-05-2010, 11:46 AM
Well basically, I'm setting up a website for a client using CMS based on an XML structure, and I'd like the client to be able to set the keywords for the page in the XML.

Just as they can with the document title in the code above.

domedia
05-05-2010, 03:35 PM
You can access it through the DOM
http://www.webmasterworld.com/forum91/2603.htm