lazyload images - index images in the search engines - javascript

I believe that Google displays the DOM also modified by Javascript.
Look I used the tool Fetch as Google/Bing/Baidu
Look at the results:
Without my jquery-plugin and noscript (ie pure HTML):
With javascript and noscript:
note: The javascript that showcased images and manipulated the DOM.
LIB Javascript
Download and test-case: https://github.com/brcontainer/defer-images/
Question:
Use <noscript> to help indexing of images is a good?
If it's a bad idea, give me an example of an HTML good for indexing images and I can use LazyLoad.
If the javascript displays images and Fetch as Google/Bing/Baidu displays the content normally (like the browser) so Google/Bing/Baidu indexes the DOM manipulated by javascript?

The search-engine will index the image grey.gif. It will never know about example.jpg.
data-* attributes are valid in HTML5 (only).
PS: Don't forget the alt attribute.

Related

Convert Bootstrap css style into plain html

Does anybody meet this requirement: I use Bootstrap css to build a html page. And I want to send this html content by email. I can use "$('#myelement').html();" to get its detailed content. But it is without css style. How can I convert Bootstrap css style to plain html, like ?
Really appericate your any idea.
Unfortunately most email clients will not accurately display an embedded stylesheet; you'll need to use inline styles and tables instead of floats, etc. Check out this thread: Best practices for styling HTML emails. Hubspot also does a great job of outlining some of the differences between web and email CSS.
You can try Emogrifier for converting External Css to Inline.
It will helps to convert and make reliable for E-mail view.
There is whole lot of differences between standard HTML + CSS as rendered in modern browsers and what actually works in HTML based email. The latter is much less standardised. Typically, you would expect to use inline styles rather than a embedded stylesheet for a lot of the CSS content to work.
This has already been discussed on this thread:
Best Practices & Considerations when writing HTML Emails

3rd party content images don't have alt attributes and meeting WCAG 2.0 Level A - javascript solution?

We have some 3rd party content coming into one of our websites that need to adhere to WCAG 2.0 Level A requirements.
The html coming in through the RSS feed doesn't provide proper alt attributes to the img tags. We were hoping to add the alt attributes using javascript. Although that doesn't make the code great if javascript is turned off, it is a lot better.
This thread
WCAG 2.0 level A and AJAX generated content
seems to imply that using other js methods with WCAG 2.0 Level A aren't a problem. I assume it would then be alright in this example.
The use of javascript does not effect WCAG compliance unless you are using javascript in a way that breaks a WCAG guideline. As a screen reader user while this will technically meet the guidelines how are you going to make sure the alt tags have actual meaning? I would rather have no alt tag rather then a misleading one.
Your assumption is right, as #Jared said JavaScript by itself isn't breaking WCAG compliance, unless used in a way that breaks accessibility.
I am also a screenreader user and hate when it reads the long awkward file name instead of a proper or empty alt text.
If you can't find a way to identify a suitable alt text you should insert an empty alt attribute (alt=""), so that screenreades won't focus/read the image. Personally I've noticed that some screenreaders focus and read the empty alt anyway, so I use the ARIA attribute `aria-hidden="true" so that the browser wont send the image through the Accessibility API.
Here is a jQuery example of detecting all images without an alt attribute and inserting an empty one.
$('img:not([alt])').each(function() {
$(this).attr('alt', '');
$(this).attr('aria-hidden', 'true');
});

Parsing HTML Response in jQuery

My page needs to grab a specific div from another page to display within a div on the current page. It's a perfect job for $.load, except that the HTML source I'm pulling from is not necessarily well-formed, and seems to have occasional tag errors, and IE just plain won't use it in that case. So I've changed it to a $.get to grab the HTML source of the page as a string. Passing it to $ to parse it as a DOM has the same problem in IE as $.load, so I can't do that. I need a way to parse the HTML string to find the contents of my div#information, but not the rest of the page after its </div>. (PS My div#information contains various other div's and elements.)
EDIT: Also if anyone has a fix for jQuery's $.load not being able to parse response HTML in IE, I'd love to hear that too.
If the resource you are trying to load is under your control, your implementation spec is poorly optimized. You don't want to ask your server for an entire page of content when you only really need a small piece of that content.
What you'll want to do is isolate the content you want, and have the server return only what you need.
As a side note, since you are aware that you have malformed HTML, you should probably bite the bullet and validate your markup. That will save you some trouble (like this) in the future.
Finally, if you truly cannot optimize this process, my guess is that you are creating an inconsistency because some element in the parsed HTML has the same ID as an element on your current page. Identical ID's are invalid and lead to many cross-browser JavaScript problems.
Strictly with strings you could use a regular expression to find the id="information" tag contents. Never parse it as html.
I'd try the $.load parameter that accepts a html selector as well
$('#results').load('/MySite/Url #Information');

RDFa for videos rendered in javascript

I am trying to add RDFa tags to videos so they can be indexed by Google and Yahoo. However the object and embed code for the videos are inserted by javascript, so they aren't actually in html. Can I put a duplicate object in a noscript tag? Is there another solution?
http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=162163
RDFa markup generated by Javascript is invisible to Google and Yahoo, just like other markup.
The good news is that in RDFa, the element actually doesn't matter at all; it's all about the attributes. So you can just put all the RDFa markup on <div> or <span> elements without visible content, you don't need to use <object>. You can use RDFa's resource="" attribute instead of href="" on elements that don't support href.
At least that's what the RDFa spec says; I haven't verified wether Google and Yahoo actually process it that way.
This might provide some help for the more general problem (HTML code inserted by JavaScript): A proposal for making AJAX crawlable

How to convert a PowerPoint slide into HTML?

I am trying to insert PowerPoint slides into HTML preserving links in the PowerPoint slide. I was just wondering if any of you knew a good method to maybe exporting a PowerPoint slide to an HTML and then displaying it in a div on your page, with a link to say do a JavaScript function on that same page.
I've never used it, but PPT2HTML might help. There's also this blog that describes how to save your presentation for the web then modify it.
This isn't exactly what you're after, but there are some html-based presentation tools like S5, DOMSlides you might want to consider as they wouldn't suffer from being translated.
You can use the jQuery plugin called PPTXjs.
This plugin convert pptx to html using javascript only (no server side code needed).
It is based on PPTX2HTML but support a lot more shapes, media (audio, video) and more.
Using:
$("#result").pptxToHtml({
pptxFileUrl: "path/to/slide.pptx"
});
For more details : https://github.com/meshesha/PPTXjs.
1)u can convert it to flash swf
2)convert all slides to an image file and then add 2 buttons(Back,Next) with calling the next and previous images based on an integer variable and this buttons will show u the previous and next slides :)
sorry but u cant embed it without copying all the Powerpoint-exported HTML code in your div tag
Though not quite what you asked, Google Docs or Slideshare both let you embed Powerpoint as flash - perhaps that would be a more elegant way to do this. That is, if embedding is the aim!
I remember there was a function in PowerPoint to export it to an HTML, I would do that and then have it in the page using an <iframe> and then put that inside a <div>

Categories

Resources