Relative Content

Tag Archive for html

Choosing DOCTYPE for an online eBook

I’m about to begin working on a project which involves creating an eBook-like website which will contain lots of large documents with text and images.
The site should have a rather minimalistic design, but it will include a UI with some scripting and animations to make browsing the large documents easier.

Twitter in app browser + user agent string

Recently (I believe some weeks ago) with the latest update of the Twitter app for iOS, all links found inside tweets are opened in Twitter’s build-in browser. My question is how to find Twitter’s browser agent so I can display custom messages.

How to best organize spaghetti Javascript on the client with an MVC server architecture?

A LAMP project I am currently working on is pretty well organized on the backend. However, there are a ton of pages that just have a diarrhea of javascript and html squirted all over numerous locations with little discernible architecture, rhyme, or reason. In a few cases, some kind of javascript prototype was created for a common control, and the MVC framework in place is taking care of templating pages.

How to best organize spaghetti Javascript on the client with an MVC server architecture?

A LAMP project I am currently working on is pretty well organized on the backend. However, there are a ton of pages that just have a diarrhea of javascript and html squirted all over numerous locations with little discernible architecture, rhyme, or reason. In a few cases, some kind of javascript prototype was created for a common control, and the MVC framework in place is taking care of templating pages.

How does Facebook strip html/apostrophes for XSS but also display it?

I’m not quite sure if this is a question for programmers.se rather than stackoverflow, but here goes. So Facebook [or any other large company] when given something like an apostrophe or html, can strip it of its malicious intent, but still display it properly. My current sanitizing function in PHP just strips those characters/makes them harmless via htmlentities() and such. So if I wrote an HTML tag, I would want it to be sanitized but also displayed on the website. How do I do this?