1

I've mainly done application development, but have also worked on simple web projects (where the HTML and CSS were created by the web dev guys).

Recently I tried creating a website for myself, and found it extremely annoying trying to get the placement of div's and other elements on the page right. Totally unpredictable. I've tried reading through this, but I'd like to have an environment where it's easier to position an element on the screen

I see that processing.js, paper.js and raphael.js are available, but would it be wise to use just these to create a single-page-web-app?

Would it be possible to create a web-app to be able to have

  • A homepage, with a menu which when clicked would clear the old content from the screen and load new content onto the screen
  • Be able to interact with a database like Neo4j or MongoDB
  • Have a UI which is useable on a PC browser and mobile phones

ps: I don't mind not being able to support old browsers.

4
  • 4
    All you are doing with Javascript is programatically placing the divs and other elements on the page right. Probably even more unpredictable. Sep 22, 2014 at 18:01
  • Really? Isn't there anything that can do something like image.position(x,y) where x and y are the coordinates on the browser?
    – Nav
    Sep 22, 2014 at 18:02
  • 2
    Given the number of different devices and screen sizes out there, it's probably better to use a responsive design, rather than trying to position every element at a specific pixel location. Even tables would be preferable (cue indignant howls from the semantic markup crowd). Sep 22, 2014 at 18:03
  • 2
    I have used raphael.js a bit for drawing some specific components, but I would never even consider replacing html/css with it. Html/Css are like any technology, there is a learning curve and once you have been doing it a while you will have no problem positioning things where you want Sep 22, 2014 at 18:05

1 Answer 1

6

To some extent, there are web sites that do just that, where the HTML elements are created and placed on the page and styled using CSS. But it must be kept in mind that you still need to use HTML elements and style them with CSS.

One disadvantage of doing it that way is search engines only read the content provided by the original HTML. More and more Google is able to read javascript but it's not gotten very far and it's unknown when and what that will affect as far as search results are concerned.

Which comes back to my original point, you must use HTML and CSS when you create a page, statically or dynamically, and there is no way around that.

2
  • There are frameworks available that can make layout easier for you though. Since the question mentions desktop and mobile, Bootstrap and jQuery Mobile in particular might be a good way to go.
    – HamHamJ
    Sep 22, 2014 at 19:49
  • Brad Green somehow announced during the AngularJS NYC Meetup (2014.09.18) that Google will render all Javascript by the end of this year (which still would leave us with the same SEO issue for other search engines). Sep 22, 2014 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.