plicatibu Posted November 6, 2013 Share Posted November 6, 2013 I'd like to know what you guys think it's better: to embed the game code into the page or to use an iframe for that. I read somewhere in the net that Google doesn't like iframes. What you think? What are the advantages / disadvantages of each method? Quote Link to comment Share on other sites More sharing options...
NickColley Posted November 7, 2013 Share Posted November 7, 2013 iframes are a good idea if you're distributing your game on website you don't own, similar to YouTube's embedded players, whereas YouTube don't use iframes when you're on their website itself. The main problem you have with exposing the code to a page on it's own is that it's not encapsulated so the webpage might have something that conflicts with your code and break it. With iframes everything is contained so you can rest easy there, as long as the page loads. I think you're okay with Google since your game itself can't really be indexed anyway. Thinking towards the future this kind of problem might be solved with web components. You can check out web components right now by playing with the Polymer project: http://www.polymer-project.org/ happy 1 Quote Link to comment Share on other sites More sharing options...
plicatibu Posted November 7, 2013 Author Share Posted November 7, 2013 Thank you for replying. I didn't understand when you say I think you're okay with Google since your game itself can't really be indexed anyway. Why my game couldn't be indexed? Quote Link to comment Share on other sites More sharing options...
NickColley Posted November 7, 2013 Share Posted November 7, 2013 Google can't index Javascript applications very well, so as long as you surround the canvas.webGL context with relevant data your game will be fine. E.g. If Google trawls your page and sees: <h1>Super Awesome Game</h1><canvas> It can't do anything with the canvas context but can index the header, so on a Google result you'll hit the page from the header not the canvas itself. Hope that makes sense. Quote Link to comment Share on other sites More sharing options...
plicatibu Posted November 7, 2013 Author Share Posted November 7, 2013 Oh, now I understood. Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.