|
There Will Be Penalty posted:This means you can write code such as the following: I personally can't stand this type of thing. Just because it's clever doesn't mean you should do it. When someone comes back 6 months later to read thousands of lines of code like this it's just a nightmare when it's not at all obvious what's happening without having to mentally pause for every bit of cleverness to figure it out. Use an if statement and write explicit and readable code where what's happening is instantly recognizable without even having to think.
|
# ¿ Apr 22, 2009 08:24 |
|
|
# ¿ Apr 29, 2024 08:45 |
|
Blackout posted:Hi guys, quick question for you. I've got a whole bunch of xml files which use a stylesheet to be displayed as HTML. The files are organized by folder on my computer, so that the structure looks something like this: Gonna assume you're talking about javascript in the browser since you mentioned Firefox. What you're trying to do here is traditionally a server-side thing with languages like PHP or ASP, and not done in the browser. If you're hosting your site on IIS then you are actually able to write ASP code using javascript and the FileSystemObject but this all runs on the server and security constraints aren't relevant here. If you have no sever-side programming ability and you're a true masochist you could potentially try and do something that uses ajax to parse directory listing pages on the server and build the tree from that, but don't.
|
# ¿ May 7, 2009 06:56 |
|
Blackout posted:Thanks for the advice, jupo! I guess I'll try to use IIS to do some server-side scripting with ASP or something. No problem! Being able to write javascript on both the client and server is actually a really nice environment to work with.
|
# ¿ May 8, 2009 01:50 |
|
aksuur posted:Why won't my jquery load work in firefox? It work's in IE just fine. test/test isn't working with FF or IE bro.
|
# ¿ May 8, 2009 01:53 |
|
FrozenShellfish posted:I'm making a nice website for a mobile library project in the Peruvian Andes, I tried to use javascript to make the forms easier to fill out and then I realised I don't have a clue what I am doing It'd be worth your while to check out jquery - using it you could probably reduce this down to a few lines of code as well as making it more cross-browser compatible.
|
# ¿ Jun 9, 2009 07:09 |
|
0zzyRocks posted:I need to have the user decide whether they want to save data on a webapp before navigating away. I wanted to use my own confirm window so I could capture what button was clicked. Is there a way to capture the button clicked on the default beforeunload event popup? Gmail seems to manage this - if you try and leave it before data finishes loading it presents you with a prompt that allows you to stay with the page even though you've requested to leave it. Good luck making sense of viewing their source though!
|
# ¿ Jun 18, 2009 03:01 |
|
epswing posted:Just thought I'd share a snippet I've gotten a lot of mileage out of: The location object already has all these properties
|
# ¿ Dec 5, 2009 01:43 |
|
Aye matey. Could still be useful as a function you pass urls into that aren't the current location.
|
# ¿ Dec 5, 2009 02:11 |
|
|
# ¿ Apr 29, 2024 08:45 |
|
A more clean approach would be to pass the form to the validation function:code:
|
# ¿ Apr 26, 2010 03:05 |