Tag Info

New answers tagged

4

I would say try using media queries first. One method I found easier when dealing with a design that was originally only for desktop was this: Start with two separate stylesheets. One for the new responsive design, and the other for the old desktop version: <link rel="stylesheet" media="screen and (max-width: 959px)" href="css/mobile.css"> <link ...


3

I worked on a site that used that method, and I had problems with screen rotation on mobile devices. Since JavaScript will only detect once on page load, if the user rotates the device it won't expand to the full width the way it will with media queries. It was easier for me at the time just to switch to CSS, but perhaps a JS expert would know if there's a ...


3

Responsiveness and "appear correctly on smart phones" are completely different tasks. Presumably, responsiveness refers to eliminating--where possible--extra round trips to the server. Error checking, Ajax to retrieve requested data, and dynamic DOM manipulation are the tasks that typically improve responsiveness. The use of JavaScript (or JavaScript ...


1

We used to used the popular 960.gs css framework for our sites. We wanted to make it responsive. Someone had made a JS based responsive plugin for the 960 gs so we thought hay why not just use that as we would not have to make any changes to the structural site templates. It worked but was laggy in most browsers including the good ones. You would ...


12

Sure. Obviously, it would be better to use CSS alone but if you can't, use what you have. Do as much as you can with CSS and use JS as needed. Not sure why you can't change the existing CSS but you can add a style sheet with JS. (function() { //create a new element var newStyle = document.createElement("link"); //set the required attribute for a ...


1

It might already be too late to use this idea since the spammers already know about the form: leave out a critical piece of your form (like the action attribute) and populate it using javascript when the document is loaded. Do tell visitors that the form doesn't work if javascript is disabled and remove this message when the form is set up correctly.


0

Generally the answer is still no. There are apps nowadays like PhantomJS that make it easier for an automated program to run a browser including JavaScript, however, they are typically slower. It's often much easier to scrape HTML and send direct POST requests. If a bot has problems on one site (e.g. a CAPTCHA) it will just move onto another. So if you ...


3

Using CDN(s) to shard your dependencies across many servers like this in essence represents a tradeoff between bandwidth and latency, assuming you only care about performance. I'm incidentally assuming the alternative is not simply hosting it locally, but concatenating it with a different local request - there's usually no good reason not to concatenate ...


10

Another downside: Using a CDN allows operator of the CDN to track the sites visitors. That's why they don't cost money.


17

There are two major benefits to using an external CDN such as Google to host jQuery: It's faster. It will be certainly be faster than your site, and probably faster than any CDN you set up yourself. It may already be cached. Lots of sites reference jQuery on Google's CDN as well, so if they visited another site with it before yours, they won't even need to ...


1

Using the jQuery hosted library by Google permits to your page to be loaded faster. Indeed, the library is loaded at the same time of your page instead of after.


0

All three of the methods work for what you are trying to do. The question is which are you willing to use? OR which is easier for you to do? As for my personal preference, I prefer Hashbang. For me, is the easiest to pick up and use and understand the documentation and implementation into working code.



Top 50 recent answers are included