|
UPDATE: 3/1/2011 - Added browser debuggers that can make your life a lot easier at the bottom. The old thread was loving huge, and a lot of stuff was missed so I'm going to try to make this one a bit more all encompassing. General Questions Q: How can I make two columns float and have the heights be the same? A: In reality there are a few ways. But the ones that are most prelevant are the CSS Holy Grail version and the one on Floatutorial. Q: Why does IE6/7 sometimes not display a div properly? A: It's because IE is a piece of poo poo. And you need to become familiar with the hasLayout bug to get around the issue. It really will fix the majority of issues you'll find with IE handling div's funky. Q: Why doesn't my page display properly at all? A: If you think you wrote your page with proper markup and/or proper CSS it could be because you didn't declare a document type. This is very important. I cannot stress how important it is to declare a proper document type. If you fail to do so most every browser will poo poo itself and your page will become a bunch of garbled poo poo. So please declare your doctype Q: I'm floating an element and want it's container to take into account the floated elements height, how can I do that? A: There's a stupidly simple fix. For your container element simply add code:Q: My page looks like X in Firefox but Y in IE, why is that? A: It's because all the browsers have some 'default' values for each kind of elements, when you wrote your stylesheet it took into account the default values for your development browser of choice. Use Eric Meyers CSS Reset Reloaded to get all your browsers to the same starting point. Q: I've put in the right code, my stylesheet looks right but things aren't looking like they should. Why? A: Because didn't declare your DOCTYPE properly and so the browser doesn't know exactly how to handle the html you're giving it. Read up more on it here but really you should be giving your pages either HTML 4.01 or XHTML Strict. XHTML Strict is preferred so that the browser doesn't go into quirks mode Q: I have IE7 installed but want to test my sites in IE6, can I? A: Of course you can, and no you don't need to use the stupid multi-IE that's out there because that doesn't do a 100% correct reproduction of a normal IE6 install. To get a free IE6 and IE7 virtualPC image just head over here and download the complete IE6/7/8 test suite of images. All of them also come complete with the IE Developer toolbar as a desktop exe so you can continue being productive. IF YOU'RE USING THE 'STANDALONE' VERSIONS OF IE6, STOP RIGHT NOW AND GET THESE They don't really render IE6 right, and tend to gently caress up your local install of IE7 as well, so steer clear of them unless you want to tear your hair out killing some IE6 bug no one else is seeing. NEW! Q: Why am I having X issue in IE? A: Because IE is a giant piece of poo poo. Look here for a whole big list of all of IE's issues and workarounds for almost all of them. Places to learn more These are where you can go to learn more and also get some more up to date information on the latest crazes that are sweeping the web development world. PositionEverything.net has a lot of guides about the different bugs in different browsers. This is their guide to all of IE's issues. Check out http://www.positioniseverything.net for guides to other issues. A List Apart - A monthly 'magazine' that has articles by a lot of the people who help make the internet what it is now. Great for getting tips on how to do some new and exciting things. CSS Zen Garden - A site that isn't useful for actual articles, but for a metric shitton of different designs all using the same page markup. CSS Cheat Sheet - A CSS Cheat sheet, it's loving handy so hurry and print it up right now and hang it somewhere in your cubicle. Trust me you'll refer to it at some point. Floatutorial - So you're good at making fixed-width layouts and want to learn more about liquid ones eh? Go here and read their last two tutorials, it'll show you a pretty decent way to do a liquid layout. If you want to simply use one that's already out there I suggest the CSS Holygrail it may seem a bit odd with the negative margins, but it does work. Listutorial - This is where you go to learn how to make fancy semantic menu navigation and other lists that don't really look like a list. CSS Layouts @ Code Sucks and Iron Mike's CSS Layouts - Two sites that have a lot of generic base layouts that you can use if you're having trouble creating a CSS layout by hand. But really attempt to do it by hand first, and if you just can't get it work turn to these, otherwise you won't learn anything if you just jump right into the templates. That's all I can come up with now, so if you guys have good links add a post and I'll try to update the OP with them. Frameworks If you've ever had someone in your work tell you that you need to get some of that Web2.0 stuff on your pages and you're familiar with javascript look to these frameworks to help you out. Prototype and Scriptaculous - Prototype is a framework that is one of the frontrunners for a lot of developers. It's easy to pick up and when combined with Scriptaculous you can achieve some pretty nice effects, like fading in and out of elements, and easy to run ajax calls. Some call it a bit heavy in filesize but it's not massive. jQuery - Another framework that has a lot of animation effects, and some ajax ability. The main difference between it and Prototype is that you can use your normal CSS declarations to navigate the DOM. Also has all the effects built into the core file so no need to add any secondary file. Ext JS - I've never used this but have heard it's a pretty good framework for the same kind of stuff that Prototype and jQuery can do. Editing Help/Debuggers Firebug - It's a damned godsend if you're doing debugging in FF. Couple it with Web Developer Toolbar and you can get pretty much everything edited/debugged. Plus WebDev Toolbar has a chrome version! Firebug Lite - It's designed to be Firebug but in other browsers, it's not as full fledged as normal Firebug but it's better than nothing. IE Developer Toolbar - Yes MS does actually give half a poo poo about web developers. It's really somewhere inbetween Firebug Lite and normal Firebug in what it can do. Useful for figuring out why IE is cocking up your website. Chrome DevTools - They come straight from Google and let you do a ton of debugging on Chrome. Note: I haven't used them myself but thought people should know all the tools for other browsers If you want to learn more about all things javascript related I'd suggest taking a look at Ajaxian it's a catch-all blog with a shitton of information about a lot of different frameworks and bleeding edge apps. Remember guys if you think of a question I missed please post about it so we can prevent too many repeated questions like we had in the old thread. IF YOU'RE USING THE 'STANDALONE' VERSIONS OF IE6, STOP RIGHT NOW AND GET THE VM's LINKED ABOVE They don't really render IE6 right, and tend to gently caress up your local install of IE7 as well, so steer clear of them unless you want to tear your hair out killing some IE6 bug no one else is seeing. real_scud fucked around with this message at Mar 1, 2011 around 20:10 |
| # ? Dec 19, 2007 23:17 |
|
|
| # ? May 23, 2013 10:18 |
|
I'll put this here instead of the old thread: my test page that several people were kind enough to play with was, I've realized just now, working perfectly because I left it "fixed" when I found the problem. I'm very sorry. I'll un-fix it so you can see, but it's really very simple:
Here's the setup, in code: code:
|
| # ? Dec 19, 2007 23:31 |
|
IE6 vs Others Layout Issue. In IE6 it looks like this: ![]() In IE7 and firefox it looks like this: ![]() I have a div for the top horizontal graphic which is a 3px height, non-repeating image. Then a container div after that which is the repeating background and contains the main content. I can't seem to figure out how to eliminate the space in IE6. Do i need to do some sort of hack? The site is not a public site so you won't be able to directly view the source. I am customizing a sharepoint 2007 installation. This particular issue is on a Master Page. I have tried putting margin: 0; in the code and using including a reset sheet(http://meyerweb.com/eric/thoughts/2...reset-reloaded/. Neither worked. Here is the gist of the page code: code:code:
|
| # ? Dec 19, 2007 23:52 |
|
Try removing the whitespace between the relevant divs. It's retarded but that's solved so many of my IE6 problems.
|
| # ? Dec 20, 2007 02:08 |
|
ZeeBoi posted:Tried that, didn't work.
|
| # ? Dec 20, 2007 12:22 |
|
Haha, check this out! IE8 (supposedly) passes the ACID2 test http://blogs.msdn.com/ie/archive/20...-milestone.aspx I don't know wheteher to be ecstatic with happiness or cautiously optimistic. Hmmm.
|
| # ? Dec 20, 2007 12:42 |
|
Someone in the last thread was having trouble with a two-column CSS layout that didn't match up length-wise. Here's an example of the solution, in code form:code:I know it's a little hard to conceptualize but it works. If you want to visually distinguish the two columns, just make a vertically repeating background that's a different shade behind each column. In the example above, an 800-pixel-wide GIF that's light grey for the first 200 pixels and white for the rest would give you a nice grey left column and white right column that both appear to stretch the whole way down regardless of content.
|
| # ? Dec 20, 2007 16:16 |
|
Mirage posted:Someone in the last thread was having trouble with a two-column CSS layout that didn't match up length-wise. Here's an example of the solution, in code form:
|
| # ? Dec 20, 2007 16:20 |
|
real_scud posted:But there's a lot easier way to fix that in all the browsers. Add overflow:hidden to the #outer element and it will automatically stretched to the longest element. ... well poo poo. It has its limitations but I can't believe I hadn't seen this before. Anyone know what happens if the length of a column is dynamically altered? In any case, the method I described is the old way. Because I'm old. EDIT: Just tested it with dynamic content changes, and it works great. I'm off to redesign a bunch of Web sites, I guess. Mirage fucked around with this message at Dec 20, 2007 around 16:48 |
| # ? Dec 20, 2007 16:41 |
|
Mirage posted:... well poo poo. It has its limitations but I can't believe I hadn't seen this before. Anyone know what happens if the length of a column is dynamically altered? And I believe it automatically adjusts if a column is adjusted but I can't remember atm if I've used it in that kind of situation. edit: Edited the OP to add this in the questions since I have a feeling it'll pop up again. real_scud fucked around with this message at Dec 20, 2007 around 16:58 |
| # ? Dec 20, 2007 16:49 |
|
real_scud posted:But there's a lot easier way to fix that in all the browsers. Add overflow:hidden to the #outer element and it will automatically stretched to the longest element. Wow, that's freakin sweet. And to think of all the garbage I've written to clear floats. Hidden overflow is not a solution that would have naturally occurred to me, but it beats the hell out of the usual helper divs and pseudo-element boilerplate. Edit: One small thing about your addition to the OP. With the container's overflow hidden, anything that stretches past it will just be invisible. You'll get the scrollbars if its overflow is auto. I just now slapped a page together to make sure. DaTroof fucked around with this message at Dec 20, 2007 around 17:31 |
| # ? Dec 20, 2007 17:22 |
|
Can anybody recommend a javascript library that I can use for parsing XML documents? Ideally, I want to read in an XML document from a URL and be able to programmatically iterate through all elements in the document. I know there are a bunch out there, but I can't remember the names of any of them now that I'm looking for one.
|
| # ? Dec 20, 2007 19:59 |
|
In PHP can you touch() a directory, or is there a function similar to touch() for dirs?
noonches fucked around with this message at Dec 20, 2007 around 20:40 |
| # ? Dec 20, 2007 20:14 |
|
real_scud posted:jQuery - Another framework that has a lot of animation effects, and some ajax ability. The main difference between it and Prototype is that you can use your normal CSS declarations to navigate the DOM. This isn't true. Prototype lets you do the same sort of traversal by CSS selector that jQuery does (with the $$ function). YUI, Dojo, and Ext can do this as well. jQuery simply makes this the focus of their API, such that jQuery code often resembles a domain-specific language. Thanks for creating a new thread, by the way. We need a useful first post.
|
| # ? Dec 20, 2007 22:01 |
|
Bonus posted:Did you remember to clear the floats? I gave both columns the following: code:
|
| # ? Dec 20, 2007 22:05 |
|
m5 posted:I'll put this here instead of the old thread: my test page that several people were kind enough to play with was, I've realized just now, working perfectly because I left it "fixed" when I found the problem. I'm very sorry. I'll un-fix it so you can see, but it's really very simple: OK, finally reproduced this. That's weird as hell. I suggest reducing this even further (i.e., remove the Prototype dependency) and submit this to QuirksMode's section on browser bugs. In the meantime, the workaround is quite easy: don't change the values of boxes that were guaranteed not to have changed. If you have an onblur handler for field1, you don't have to look at field2 or field3. Use event.element() (in Prototype) rather than some sort of global collection.
|
| # ? Dec 20, 2007 22:24 |
|
savetheclocktower posted:This isn't true. Prototype lets you do the same sort of traversal by CSS selector that jQuery does (with the $$ function). YUI, Dojo, and Ext can do this as well. jQuery simply makes this the focus of their API, such that jQuery code often resembles a domain-specific language. I know you're involved with Prototype so if there's anything you want to add that'd be great. Or if you can summarize Prototype better than me, please do so.
|
| # ? Dec 20, 2007 23:04 |
|
noonches posted:In PHP can you touch() a directory, or is there a function similar to touch() for dirs? According to the manual you can't touch directories on windows so I'd assume that means you can touch them on non-windows systems.
|
| # ? Dec 20, 2007 23:25 |
|
savetheclocktower posted:In the meantime, the workaround is quite easy: don't change the values of boxes that were guaranteed not to have changed. Yes, that's what I did. The actual case I had was a month-day-year set of fields. I was trying to re-use the "onSubmit" validation code to clean up the field values on the fly. I decided that was weird anyway, so my page is now working nicely even in dumb old IE.
|
| # ? Dec 21, 2007 03:20 |
|
real_scud posted:Yeah I know you can do it with the $$ function but like you said, DOM traversal via CSS-type selectors is a cornerstone of jQuery. I mentioned it only because the wording implies it's a feature jQuery has and Prototype doesn't. Both implement all of CSS3; jQuery has some custom syntax on top of that, but not much. Other than that, your description of Prototype is fine, and our web site explains it far better than anything I'd write on my own.
|
| # ? Dec 21, 2007 03:22 |
|
edit: whoops, i meant for this to go in the database questions megathread
fletcher fucked around with this message at Dec 21, 2007 around 08:47 |
| # ? Dec 21, 2007 04:04 |
|
In PHP, if I have an array that's assigned to an element in another array, how do I reference the values an array that is assigned to an element of another array? For example: php:<? $foo['example'] = array ( 'x' => 1 'y' => 2 'z' => 3 ); ?> Tap fucked around with this message at Dec 21, 2007 around 19:01 |
| # ? Dec 21, 2007 18:53 |
|
Tap posted:In PHP, if I have an array that's assigned to an element in another array, how do I reference the values an array that is assigned to an element of another array? You mean $foo['example']['x'] ?
|
| # ? Dec 21, 2007 19:03 |
|
duz posted:You mean $foo['example']['x'] ? So, if I created an array the way I described in the example, and I said php:<? $x = $foo['example']['x']; echo $x; ?> EDIT: Just tested it and it works. COOL. Tap fucked around with this message at Dec 21, 2007 around 19:13 |
| # ? Dec 21, 2007 19:09 |
|
Here's another dumb programming question that I need to wrap around my brain. Would this be an example of an instantiated class object? $foo = new Foo(); Assuming Foo() is defined as a class somewhere.
|
| # ? Dec 22, 2007 05:35 |
|
Yes, thats exactly what it is.
|
| # ? Dec 22, 2007 05:42 |
|
So creating a static method in a class allows you to call that method from that class without having to instantiate the class object, but only using the ::, and not ->, correct? And I'm going to assume the same goes for static members as well.
|
| # ? Dec 22, 2007 05:55 |
|
Tap posted:So creating a static method in a class allows you to call that method from that class without having to instantiate the class object, but only using the ::, and not ->, correct? Yup.
|
| # ? Dec 22, 2007 06:12 |
|
I need help with the jQuery.treeview() plugin- I didn't choose this framework and I didn't make the design or have much choice in all the functionality so please only help me fix this issue. I can't really change much of what you see. I am the coding pawn of this project. OKAY... anyway-- Treeview() is not working very well in IE6 and IE7. Expected behavior is working in Firefox. After you click one plus / minus img in the left side list, it stops working. Can someone help? http://www.joesak.com/cbi/ Thanks! phazer fucked around with this message at Dec 26, 2007 around 14:28 |
| # ? Dec 22, 2007 18:37 |
|
What is a good (free) ftp client to use? I would really like something that can open files in the default program when downloaded, and automatically upload them when I save them. If it can support multiple files being open at the same time that would be a major plus.
|
| # ? Dec 25, 2007 17:54 |
|
Maniaman posted:What is a good (free) ftp client to use? I would really like something that can open files in the default program when downloaded, and automatically upload them when I save them. If it can support multiple files being open at the same time that would be a major plus. I think FileZilla can do this. I'd say FlashFXP is worth paying for though, it's an awesome ftp client. If you are just editing code on a webserver via FTP though, editplus is perfect for that.
|
| # ? Dec 25, 2007 22:30 |
|
This seems like the place to ask this. I've been working on a unified theme across SMF/Wordpress/Mediawiki, and it is pretty good so far. The two main problems are IE incompatibility (Which I haven't gone around trying to fix) and the main page overflowing it's bounds. overflow: hidden doesn't seem to help. This is the site: http://bottlabs.org/action/history/Main_Page This is a picture of what I'm talking about : ![]() Notice how the history info overflows the bottom? I'm trying to fix that. Oh, and for that entire theme all I added was the header info and modified the css from monobook. I'm proud of it. Any tips?
|
| # ? Dec 26, 2007 03:18 |
|
I'm learning Ruby. Now that I've got language basics down, I'm looking at using third party gems in my programs. Now, in php I could just download whatever project I needed, drop it in a folder, and require 'someprojectdir/projectbaseclass.php'; Ruby also has require, but as I understand it gems are system wide plugins, versus some files in my arbitrary directory like php? This is moderately distressing. Does it mean I won't be able to use third party modules that aren't provided by my web host? I googled the question, and found some potentially promising answers, but they all necessitated use of some "gem" utility which apparently isn't available on my host. So the question is, is there some way to install gems myself/use gems without installing them system wide on a shared web host account? e: Battle Bott posted:I'm sure that this is host specific. Factor Mystic fucked around with this message at Dec 26, 2007 around 07:47 |
| # ? Dec 26, 2007 05:31 |
|
Factor Mystic posted:I'm learning Ruby. Now that I've got language basics down, I'm looking at using third party gems in my programs. Now, in php I could just download whatever project I needed, drop it in a folder, and require 'someprojectdir/projectbaseclass.php'; Ruby also has require, but as I understand it gems are system wide plugins, versus some files in my arbitrary directory like php? This is moderately distressing. Does it mean I won't be able to use third party modules that aren't provided by my web host? I googled the question, and found some potentially promising answers, but they all necessitated use of some "gem" utility which apparently isn't available on my host. I'm sure that this is host specific. There is a guide somewhere on how to set up svn+ror+gems on a bluehost account through ssh. Do you have shell access to your host? If not, you might be in trouble. This is the guide: http://www.bluehostforum.com/showthread.php?t=9838
|
| # ? Dec 26, 2007 05:40 |
|
Battle Bott posted:http://bottlabs.org/action/history/Main_Page Remove the position:absolute; on #column-content. Absolutely positioned elements don't effect the layout of their containers. This will cause a new problem where your right column appears below the left column, it's because they exceed the width of their container when side-by-side. Remove the left margin on #column-one to correct this.
|
| # ? Dec 26, 2007 16:24 |
|
In javascript, if I have something like: for (key in thisObj) { alert(key); eval("alert(thisObj."+key+")"); } Is the only way to access the keys value to use eval as shown? Or am I missing something obvious? (thisObj.key did not work)
|
| # ? Dec 26, 2007 18:48 |
|
fletcher posted:Is the only way to access the keys value to use eval as shown? Or am I missing something obvious? (thisObj.key did not work) code:
|
| # ? Dec 26, 2007 19:01 |
|
I haven't touched any Ruby on Rails for a few months, and now I'm diving back in only to find that rails 2.0 is out and is quite a bit different from the prior version. The scaffolding differences threw me off especially, but I have that mostly figured out now. What I'm stuck on now is RJS. I need a form where the user selects something from a select field, then based on that selection several other form fields are populated. For example, think of an online store asking you to select one of your saved addresses, then it fills in the address in the fields when you select one. I tried starting out with this tutorial, but I can't even get that simple code to work. I did rename the .rjs file to .js.rjs. I believe I'm missing something in the controller...right now the remotely called function consists of only the declaration: code:
|
| # ? Dec 26, 2007 20:25 |
|
fletcher posted:In javascript, if I have something like: code:
|
| # ? Dec 26, 2007 20:52 |
|
|
| # ? May 23, 2013 10:18 |
|
How do I run my onSuccess function in the request function?code:
|
| # ? Dec 26, 2007 20:59 |























