Question

Cut straight to the chase, I'm using Text.prototype.splitText for help in data binding, but I've never seen it used before anywhere.

I want to know of any bad parts about it, something I would need to know before depending on it.

First off, I was thinking about search engines, Seeing as your splitting up text that shouldn't really be split up, but there's no change visually.

Will search engines treat text differently

For example

Hello {{name}}, how are you.
You live at {{address}}, somewhere.

This would end up like this in the DOM, not visually

Hello 
John
, how are you.
You live at 
77 some drive, some city
, somewhere.

Maybe Search engines treat them as different paragraphs?

So I wan't to know about this and any other bad points i should know about, thanks.

Was it helpful?

Solution 2

From Matt Cutts, head of Google's webspam team: "Is excessive whitespace in the HTML source bad?"

Source: http://www.youtube.com/watch?v=u55Rn1mYgO8&feature=player_embedded

We really don’t care that much. We’re pretty good, you know, anytime we see white space, we’ll separate stuff, and we can ignore white space. So it really doesn’t cause us a lot of harm either way. The only thing to really pay attention to is I have seen some sneaky people who will try to do hidden text or whatever and they’ll start off their HTML with like 60 new lines. Right? So whenever you view source code you’re like, "Oh man, it’s blank, there is no source. Whoa, dude, you just blew my mind!" And anybody who is savvy is like, "or I can use the scroll bar, and see what's down here." So, you know, I would just use whatever white space is reasonable for you. [...] And Google does a very good job about, you know, finding separators and breaking it. So, um, don't, you know, make one word for every 200 blank lines. But otherwise, you know, as long as you're doing normal reasonable stuff I wouldn't worry about it that much.

Search spiders will simply ignore any extra whitespace (just like your web browser will). So to answer your question about white space and SEO, no, it won't negatively affect your SEO. His only caution seems to be against including hundreds of blank lines in your source code, though I'm not sure why even that would matter.

But as Stepan Riha mentioned, search spiders don't have javascript enabled anyway, so this would only matter if you were pre-rendering it before passing it to the browser.

OTHER TIPS

Since you're dynamically manipulating the DOM with client-side JavaScript, this is not something that search engines will see.

But, it looks to me like you're reinventing the wheel. Why not use a templating library like Handlebars or one of the many existing data binding frameworks like Angular or Knockout?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top