Search Amazon.com:
Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«278 »
  • Post
  • Reply
real_scud
Sep 5, 2002

One of these days these elbows are gonna walk all over you


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:
overflow:hidden
To the css for it, and poof! It will magically expand to cover the child element. But remember you have to be careful in setting a width and height for the container element because if the child becomes bigger than it's parent you'll see some nasty scrollbars.

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

Adbot
ADBOT LOVES YOU

m5
Oct 1, 2001


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:
  • Have a form with at least two input fields
  • Write an event handler on the "blur" and "change" events for both fields. Have that handler perform an assignment to the "value" attribute of both fields.
  • Tab out of one into the next, and you'll see the problem

Here's the setup, in code:
code:
  <input type='text' id='i1'>
  <input type='text' id='i2'>
  <!-- ... -->
  <script>
    $('i1', 'i2').each(function(inp) {
      ['blur', 'change', 'cut', 'paste'].each(function(ecode) {
        inp.observe(ecode, function() {
          $('i1', 'i2').each(function(boof) { boof.value = value.replace(/x/, ''); });
        });
      });
    });
  </script>
This is a pretty simple deal, but I feel bad for leaving people hanging. Thanks for looking at it.

langer34
Mar 3, 2004
<-- Granpappy Wasn't No Monkey

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:
<div class="logo">
    ///Logo stuff
</div>
<center>
    <div class="topGraphic"></div>
</center>
<div class="master">
<table cellpadding="0" cellspacing="0">
    <tr>
        <td class="shadowLeft">
            <div class="spacer"></div>
        </td>
        <td valign="top">
            <div class="masterContent">
                <div class="topNavContainer">
                    <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
                    
                     ///A bunch of sharepoint stuff here.
                    
                    </asp:ContentPlaceHolder>
                </div>
                <div class="pageContentContainer" runat="server">
                    <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" >
                    </asp:ContentPlaceHolder>				
                </div>
            </div>
        </td>
        <td class="shadowRight">
            <div class="spacer"></div>
        </td>
    </tr>
</table>
</div>
<center>
    <div class="footer">
        <div class="footertext">
            //footer stuff
        </div>
    </div>
</center>
Here are the relevant css classes

code:
.topGraphic
{
	width: 938px;
	height: 3px;
	background-image: url('../../Images/LandingPage_Background_top.gif');
	background-repeat: no-repeat;
	
	padding-bottom: 0px;
}
.master
{
	width: 938px;
	height: 100%;
	min-height: 100%;
	margin-left: auto;
	margin-right: auto;
	background-image: url('../../Images/LandingPage_Background.gif');
	background-repeat: repeat-y;
	margin-top: 0;
	margin-bottom: 0;
}
.masterContent
{
	min-height: 100%;
        margin-top: 2px;	
}
.topNavContainer
{
	background-image: url('../../Images/TopNav_Background.gif');
	background-repeat: repeat-x;
	height: 50px;
}

bitreaper
Jan 1, 2007



Try removing the whitespace between the relevant divs. It's retarded but that's solved so many of my IE6 problems.

Bonus
May 12, 2007

im gay

ZeeBoi posted:

Tried that, didn't work.
Did you remember to clear the floats?

Bonus
May 12, 2007

im gay

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.

Mirage
Oct 27, 2000

At least CyberLowtax likes me.

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:
<div id="outer" style="width: 800px; background-image: url('image_that_repeats_vertically.gif');">
  <div id="left" style="width: 200px; float: left;">Hi I am a long left column<br />left column<br />left column</div>
  <div id="right" style="width: 600px; float: right;">Hello I am a short right column</div>
  <div id="spacer" style="height: 0px; clear: both;"></div>
</div>
The "spacer" div at the end pulls the "outer" div down to the bottom of both columns. Without the spacer, the "outer" div will have a height of 0, since floating an element removes it from the height and width calculation of its container, and everything else inside the "outer" div is floating. Adding an empty element with "clear: both" pushes it below all the floaters. The container stretches to accomodate it.

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.

real_scud
Sep 5, 2002

One of these days these elbows are gonna walk all over you


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:
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.

Mirage
Oct 27, 2000

At least CyberLowtax likes me.

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

real_scud
Sep 5, 2002

One of these days these elbows are gonna walk all over you


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?

In any case, the method I described is the old way. Because I'm old.
It's ok I didn't know it until someone else told it to me here. But now I use it often and it's a loving godsend.

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

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof


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

Heffer
May 1, 2003


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.

noonches
Dec 5, 2005

It represents my lifestyle and stratus as a street savy irreverent youth, who lives large, and yet hungers for the next level in life.

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

savetheclocktower
Sep 23, 2004

You wait and see, Mr. Caruthers. I will be president! I'll be the most powerful president in the history of America. And I'm gonna clean up this country!

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.

ZeeBoi
Jan 17, 2001



Bonus posted:

Did you remember to clear the floats?
Well I found a different method.

I gave both columns the following:

code:
padding-bottom: 32767px;
margin-bottom: -32767px;
And it works just fine across major browsers.

savetheclocktower
Sep 23, 2004

You wait and see, Mr. Caruthers. I will be president! I'll be the most powerful president in the history of America. And I'm gonna clean up this country!

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:
  • Have a form with at least two input fields
  • Write an event handler on the "blur" and "change" events for both fields. Have that handler perform an assignment to the "value" attribute of both fields.
  • Tab out of one into the next, and you'll see the problem

Here's the setup, in code:
code:
  <input type='text' id='i1'>
  <input type='text' id='i2'>
  <!-- ... -->
  <script>
    $('i1', 'i2').each(function(inp) {
      ['blur', 'change', 'cut', 'paste'].each(function(ecode) {
        inp.observe(ecode, function() {
          $('i1', 'i2').each(function(boof) { boof.value = value.replace(/x/, ''); });
        });
      });
    });
  </script>
This is a pretty simple deal, but I feel bad for leaving people hanging. Thanks for looking at it.

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.

real_scud
Sep 5, 2002

One of these days these elbows are gonna walk all over you


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.

Thanks for creating a new thread, by the way. We need a useful first post.
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 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.

duz
Jul 11, 2005

Excellent. The Arkham Asylum
shower cam is operational.

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.

m5
Oct 1, 2001


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.

savetheclocktower
Sep 23, 2004

You wait and see, Mr. Caruthers. I will be president! I'll be the most powerful president in the history of America. And I'm gonna clean up this country!

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 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.

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.

fletcher
Jun 27, 2003

ken park is my favorite movie

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

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.

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

duz
Jul 11, 2005

Excellent. The Arkham Asylum
shower cam is operational.

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?

For example:

php:
<?
$foo['example'] = array (
'x' => 1
'y' => 2
'z' => 3
);
?>

You mean $foo['example']['x'] ?

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.

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;
?>
$x would echo 1?

EDIT: Just tested it and it works. COOL.

Tap fucked around with this message at Dec 21, 2007 around 19:13

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.

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.

noonches
Dec 5, 2005

It represents my lifestyle and stratus as a street savy irreverent youth, who lives large, and yet hungers for the next level in life.

Yes, thats exactly what it is.

Tap
Apr 12, 2003

Note to self: Do not shove foreign objects in mouth.

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.

minato
Jun 7, 2004

cutty cain't hang, say 7-up.

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?

And I'm going to assume the same goes for static members as well.

Yup.

phazer
May 14, 2003

chirp chirp i'm a buffalo

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

Maniaman
Mar 3, 2006


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.

fletcher
Jun 27, 2003

ken park is my favorite movie

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.

sdobz
May 6, 2007
Moron.

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?

Factor Mystic
Mar 19, 2006

Baby's First Post-Apocalyptic Fiction

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.

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
No go on this, because like I said, apparently the host doesn't have "gem" installed, just regular ruby. I'm not even sure if that's the right way to explain it; ruby 1.8.1 is available, but gem isn't.

Factor Mystic fucked around with this message at Dec 26, 2007 around 07:47

sdobz
May 6, 2007
Moron.

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.

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?

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

Semisomnum
Aug 22, 2006
Half Asleep


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.

fletcher
Jun 27, 2003

ken park is my favorite movie

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)

minato
Jun 7, 2004

cutty cain't hang, say 7-up.

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:
for (key in thisObj) {
   alert(thisObj[key]);
}

Cock Democracy
Jan 1, 2003

Now that is the finest piece of chilean sea bass I have ever smelled

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:
def add
end
Any ideas? And are there any books written specifically for rails 2.0?

Lumpy
Apr 26, 2002

How about a twist of I gouge your fucking eyes out?

fletcher posted:

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)

code:
thisObj[key]
Ooops, didn't realize the page was an hour and a half old when i replied. EFB

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

How do I run my onSuccess function in the request function?

code:
function doSomething() {
	new request('path/to/script', {
		method: 'post',
		vars: {
			key : value
		},
		onSuccess: function(response) { alert(response); }
	});
}

function request(url, params) {
	//create XMLHttpRequest
	//set headers
	http.onreadystatechange = function handleHttpResponse() {
					if ((http.readyState == 4) && (http.status == 200)) {
						//run params.onSuccess with http.responseText
					}
				};
}
I can't think of a way to get to it besides parsing out the guts of the function and doing an eval() on it. What's a better way?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«278 »