I have created Schema.org code using schema.creator site for my local business and my products. I want this code to use in my company website. I have couple of questions on this:
Is it fine to paste this code in my index.html page?
Where exactly do I need to paste this code in the HTML page? I tried to paste it under head, and the content is directly displaying in the browser.
I have created the code to get Rich Snippet. Is it correct way to create Rich Snippet?
Schema tags should be inside the body tag.
I do not use a generator but always look at schema.org as reference and validate them with Google testing tool.
Related
I'm making a template, in this template I want to include a link that will send me to its own edit page so that it can be easily accessible from the pages it is included in (very similar to Wikipedia's "view - edit - discuss" links), but I want to do it without extensions. Is it possible? how?
I tried using[[{{PAGENAME}}?action=edit]] but it automatically converts that link to {{PAGENAME}}%26action%3Dedit&action=edit&redlink=1. Using html anchors doesn't seem to work either, they are not parsed.
i like singlepages with anchors but i have seen, that site:domain.com only show one result on google.
my sections are like
<div id="section">content...</div>
and my links are like:
section link
is there a way to build the singlepage a other way to get a result for each section? i dont like to use any frameworks...
I think the only way now is to pre-render the website on your server, using something like PhantomJS and serve the result to the Google crawler. Creating a sitemap can also help.
With no URL change and all the content in the HTML document - Google will only see one page.
Google indexes complete web pages. It will not separately list anchor links to the same page.
Either split your document into multiple pages or paginate content using different URLs.
I'm trying to extract the overall comments number from a web page using Jsoup.
For example, here is a page (CNN): http://edition.cnn.com/2011/POLITICS/07/31/debt.talks/index.html?hpt=T1
I see that the class ID is cnn_strycmtsndff, but can't get to find the right command to extract it.
Can someone help?
Thanks
Unfortunately, I don't think Jsoup is going to cut it. If you use the Chrome developer tools you can clearly pick out the HTML used for presenting the "(##### Comments)" section, but if you just view the source, none of that information is there. It seems like they are using some Javascript to dynamically embed the information in the page.
This is what you see in "View Source":
<div id="disqus_thread"></div><script type="text/javascript" src="http://cnn.disqus.com/embed.js"></script>
So Jsoup will never be able to see the elements with the comment information.
I am new to html. I am trying to attached multiple html page on the server (in the memory) and send it back as one page to client (asp.net mvc 3) but my html source tags are mixing up with each other (resulting into wrong layout) if one of my html source content has not closed the tags properly and does something funny with its layout.
How can I do this such that each html content is displayed independent from other html contents one after each other?
EDIT: I should have mentioned that I have no control over the source html content that I need to attach together so it the source html is wrong, it will come to me wrong!
Short of having separate documents, fetched by separate HTTP requests all viewed in (i)frames — you can't.
Write code that doesn't output invalid HTML instead.
I am also new to html and have dealt with this kind of problem simply by changing my code editor. Try using one that highlights the start and the end of the html tag. Personally I use Komodo IDE or Notepad++.
Is iframe should not be used ever?
how screen reader behaves with
iframed content?
Without iframe how we can embed any
PHP page into asp.net based site?
What are cross browser alternatives?
I don't see why using an iframe is a problem.
If you can't use it then you could either use javascript to download and insert the generated html from the php page, or you could download the html in your asp.net server-side code and insert the html in a control.
Either approach should work well, but using javascript across domains is difficult.
If you go for the asp.net server-side approach you could do the following:
First insert an control where you want to include the html from the php page
In your Page_Load event use the WebClient to download the html as a string
Remove the <html>, <head> and <body> tags so that you only have the pure html markup. You may want to add any script- and css-references to your page if they are needed.
Assign the cleaned html to the Label controls Text property.
This will work, but there are a few points to make:
First you should consider if you trust the source of the php page. If you don't then you will want to do some extra cleaning of the html before displaying it
Second, you will probably want to cache the downloaded html so that you don't have to download it for each page view.