How to Have Separate Metadata for jQuery Tabs
Extract and separate metadata from website tabs you constructed using JQuery, a Java-based technology that allows you to easily create interactive websites. Metadata provides key information about embedded Web content to search engines so that Web users are able to locate websites in search results. If you don't manually extract metadata from the content of JQuery tabs, search engines aren't able to read the metadata and, therefore, aren't able to catalog your site's content accurately.
Instructions
-
-
1
Open the HTML file for the page where the JQuery tabs display. If the tabs display prominently on your site's homepage, open "index.html."
-
2
Start a new line within the HTML document anywhere within the "<html></html>" tags. Paste in the following code:
<li class="someclass {some:'random', json: 'data'}">...</li>
<script>
$('li.someclass').each(function(){
var data = $.metadata.get(this);
alert(data.some);
});
</script> -
-
3
Replace "someclass" with the class name you have ascribed to your JQuery tabs. By default, this is "ui-tabs."
-
1
Tips & Warnings
It is essential not to delete any portion of the "<script></script>" tag within the second part of the JQuery code. Otherwise, the site doesn't interpet the JQuery coding within the tags as JavaScript and displays it as plain text within the Web page, rather than invisible metadata aimed at search engines.