# Does anyone know javascript



## IdleStatus (Jan 5, 2011)

Hi there 

I dont know if anyone can help but im trying to put the last finishing touches to my comic site, and one of the last things i need to do is get a nice  Now and next slideshow feature going on the front page , 

http://www.idlestatus.com/

i've tried looking through the internet for something to help but Google can only go so far , 
does anyone know of any site that has a simple coding for a First; previous; new and next function.
or better yet is there anyone out there that knows how to right code.


----------



## cherylfoster (Jan 8, 2011)

I found a lot of Javascript form fields pre-existing for two separately, or use a calendar to choose a single date, but does nothing to change what the range is the date Google Analytics.


----------



## dinosaurdammit (Jan 9, 2011)

your best bet is to go to the black market with a request to see if anyone there can help you. You are more often than not going to find someone good at coding.


----------



## Ricky (Jan 11, 2011)

http://www.lokeshdhakar.com/projects/lightbox2/


----------



## RockTheFur (Jan 11, 2011)

What you could also do is use Actionscript. I prefer it over Java, even though I am taking courses in it. They teach you SIMPLE BULLSHIT.


----------



## Aden (Jan 11, 2011)

"Next"/"Prev" buttons for comics are more in the realm of PHP, not Java. Or you could just do it by hand.



RockTheFur said:


> What you could also do is use Actionscript.


 
And if you make your site Flash-based I will find a way to gut you over the internet.


----------



## Ricky (Jan 11, 2011)

OK, people:

1.) JavaScript =/= Java.  There's a pretty big difference, here.

2.) Server side refreshing is so last millennium.  Learn to Ajax.


----------



## Aden (Jan 11, 2011)

Ricky said:


> 2.) Server side refreshing is so last millennium.  Learn to Ajax.


 
Being able to send people links to specific comics is so last millennium too


----------



## Ricky (Jan 11, 2011)

Aden said:


> Being able to send people links to specific comics is so last millennium too


 
I don't think this is a large enough issue to warrant a page refresh every time you click "next" in a slideshow.

It will also look like crap since there's no way to control the transition on the page.

I mean...  You *could* do things the wrong way because you can't figure out how to add drill-down functionality in your slideshow but I guess two each his own.


----------



## Aden (Jan 11, 2011)

Ricky said:


> I don't think this is a large enough issue to warrant a page refresh every time you click "next" in a slideshow.


 
Then you obviously haven't had many web design customers. Usability > the extra 50kb you need to download to get the next page.


----------



## Ricky (Jan 11, 2011)

Aden said:


> Then you obviously haven't had many web design customers. Usability > the extra 50kb you need to download to get the next page.


 
Do you understand what I mean by drill-down functionality?

What you're describing isn't a difficult problem to solve, at all.


----------



## Runefox (Jan 11, 2011)

AJAX = Javascript = More crap the client has to download at once, particularly if it's a framework or something like jQuery or MooTools. Oh yeah, not to mention if the client's browser has Javascript disabled (many MSIE security fixes prior to patch day equate to 'disable Javascript' - Not to mention NoScript and Google Chrome's script whitelist feature, which not only helps plug security holes, but also generally speeds up page rendering, particularly when web developers are lazy and don't put the script tags at the bottom of the page), AJAX fails to work at all. If you're going to use Javascript, you use it as a supplemental feature, not as the backbone of a site. If someone hits your site and can't view it, they're going to laugh and walk away. They won't jump through hoops just because you think it's cool to do things a certain way. For every bit of functionality that Javascript provides beyond simple convenience measures (like clearing a text box of default text on focus), there MUST be an equivalent non-Javascript function, or else your website is by definition broken.

A page refresh is exactly what people expect when they click your next button. If you have an AJAX function set up, make sure that when they have Javascript off and they click that button, that they'll actually get somewhere.

Also lol page transitions. Welcome back to 1990's Internet Explorer, kids!


----------



## Ricky (Jan 11, 2011)

Right, AJAX "fails to work at all."  That must be why it's an industry standard. :roll:

Nobody has JS disabled these days because the internet won't work.  If they do, they probably know why they have constant problems.

Also, yeah -- it should be unobtrusive and work without JS.  This is stuff people should know when they are designing a web page.

No offense to people in this thread but I don't know why I'm arguing this with people who don't seem to know the difference between Java and JavaScript.


----------



## Runefox (Jan 11, 2011)

Ricky said:


> Right, AJAX "fails to work at all."  That must be why it's an industry standard. :roll:


... What? First off, way to read, skippy. I said if Javascript is disabled, AJAX fails to work at all - Hence all your fancy buttons and transition effects from the 90's won't work.



> Nobody has JS disabled these days because the internet won't work.  If they do, they probably know why they have constant problems.


I just told you a few reasons why people would disable Javascript - Security, where Microsoft usually recommends disabling Javascript whenever a zero-day exploit is found; speed, where Javascript (and AJAX in general) requires more HTTP requests, inflates the size of the page and generally slows reaction speed, especially on slower browsers like IE; and one I didn't mention would be privacy, where third-party scripts are often used to hook for advertisements and even to display them (especially via pop-unders and popups, both of which are impossible without Javascript enabled). There's a reason NoScript is a very popular plugin for Firefox, and why it's been hotly requested for Google Chrome (and partially integrated into the browser's base functionality). Furthermore, AJAX is not accessible either by search engine crawlers nor by screen readers and other accessibility software, which further limits its usage. Screen readers probably aren't a problem for a comic site, but any other site, especially with information on it, needs to be accessible. There's also the matter of mobile browsers (not every mobile phone runs Safari or Chrome) and text browsers.

Generally, if someone has JS disabled, they aren't going to enable it just so they can view your site unless you're bigger than Jesus, like YouTube, Facebook or Twitter (or perhaps depending on who you ask, specifically ensuring that no Javascript ever runs on those sites). While I appreciate that you understand that it's absolutely necessary to provide alternative methods for accessing content handled by AJAX, I get the feeling that you're the type who designs the AJAX first and then tries to pick up the crumbs later.


----------



## Aden (Jan 11, 2011)

Ricky said:


> Nobody has JS disabled these days because the internet won't work.  If they do, they probably know why they have constant problems.



An average of 10.14% that come to my sites do not have Java support. And if "the internet won't work" without JS enabled, the internet needs to whip its ass into shape.



> No offense to people in this thread but I don't know why I'm arguing this with people who don't seem to know the difference between Java and JavaScript.


 
Oh no, I was too lazy to type out "script". Obviously I don't know that there's a difference between the shit-tastic language I took in high school and Javascript.


----------



## Ricky (Jan 11, 2011)

Whatever.  This conversation is dumb.

Basically you're trying to argue you shouldn't do things a better way but you have no good reason for it.

If you don't know how to write unobtrusive JavaScript, that's one thing but I have a feeling neither one of you really have any experience in this.


----------



## Runefox (Jan 11, 2011)

Ricky said:


> If you don't know how to write unobtrusive JavaScript, that's one thing but I have a feeling neither one of you really have any experience in this.



Actually, I have a lot of experience with this; My current job is as a web developer. I don't write much Javascript myself, but I'm extremely skilled with site optimization, and with that and my general knowledge as a power user, I know that there are a lot of situations where Javascript isn't appropriate, because I also know that you can't rely on Javascript being supported/enabled on every platform. As a web developer, the most important issue at hand is always the greatest possible accessibility, which also includes page load speed - People still do use dial-up. Like I said: As long as it fails gracefully, that's fine. But you DID say earlier: "Server side refreshing is so last millennium. Learn to Ajax." ... Which basically tells me that the sites you create are probably very dependent on Javascript/AJAX functions.

If you take a look at the link in the first post, that site is *incredibly* slow. There are no fewer than eight external scripts in total (one being an IE6-specific one), five stylesheets (one of which, custom.css, is @imported over a hundred times(!?) and another, nav.css, popping a 404), and I haven't really bothered to look yet, but I'd hazard to guess the images aren't optimized, either. ... Yeeeeeup. button.png is ~9KB, can be dropped to <2.75KB. I think that fairly neatly outlines my point for performance, though Javascript isn't the only factor. Also, fails W3C markup validation and CSS validation. Should take a look here for a checklist of things to look over. Not all of it is relevant, but a lot of it is just best practice. In addition, looking at the site without Javascript, it works fine. Why are there 8 external scripts when all you're doing is a lightbox?

Here's a great collection of resources for fixing these kinds of problems, and Google Page Speed and YSlow are browser extensions for Firefox (requires Firebug) that can analyze for potential performance issues and offer suggestions for fixing them.


----------



## Aden (Jan 11, 2011)

What RuneFox said, pretty much to the letter. Progressive enhancement, not dependence. And uh



Ricky said:


> If you don't know how to write unobtrusive JavaScript, that's one thing but I have a feeling neither one of you really have any experience in this.


 
I kind of make people websites for a living right now


----------



## Ricky (Jan 12, 2011)

Jesus fucking Christ...



Runefox said:


> But you DID say earlier: "Server side refreshing is so last millennium. Learn to Ajax." ... Which basically tells me that the sites you create are probably very dependent on Javascript/AJAX functions.


 
No, it means it's what people use these days when they are developing web applications and actually know what they are doing.  I'm not sure what kind of "web development" you do that doesn't require JavaScript but that sounds more like "web design" to me. All of the major RICH INTERNET APPLICATIONS I can think of these days use Ajax (and many depend on it) so I think it's a really naive and cocky to say it is worthless.  I'm not talking about furry websites or your local pizza shop but rather companies like SalesForce, Atlassian...  um...  GOOGLE and ah, what the fuck.  You get the point.

But I digress.  The OP was asking for JAVASCRIPT and a SLIDESHOW.  I was replying to Aden's post saying you "should use PHP" for this and not "Java" (apparently he was just being lazy and actually knew this is a different programming language).  That could technically work, as well as simply making a next image a hyperlink (assuming it's a flat site) but trying to tell me that's a "better solution" than all the Javascript (or even _Flash_) widgets that are out there, I think that's a bit ridiculous.  That's not even really a slideshow at that point.

He presented me with a problem here; getting the URLs to send to people easily but I don't think this is difficult problem to workaround at all.

Also - Rune, you may have noticed -- the link I posted for lightbox because it *is* unobtrusive; it is designed this way and acts as a layer on top of whatever is currently in place.

EDIT:  Oh, also regarding the performance part...  The prototype framework is one of the most commonly used libraries in JS (next to JQuery).  That's one of the scripts out of 3 that lightbox uses.  I'm aware you can reformat images but I don't really want to get in a conversation with you about code optimization since you basically said you don't even use JS.



Aden said:


> I kind of make people websites for a living right now



I started a business like that when I was 15.

I work on core RIA/cloud development.


----------



## Aden (Jan 12, 2011)

Ricky said:


> But I digress.  The OP was asking for JAVASCRIPT and a SLIDESHOW.  I was replying to Aden's post saying you "should use PHP" for this



You misread me. I was suggesting PHP for the part in the OP that said:



> does anyone know of any site that has a simple coding for a First; previous; new and next function.



Store comic page and description in db, populate page request with comic page and description from db. It had nothing to do with a slideshow, just a standard comic site.



> I started a business like that when I was 15.
> 
> I work on core RIA/cloud development.


 
I am so very happy for you. I'm just a 3D artist and hopefully future engineer that needs some cash in the interim between schooling, but I have done my research and I don't believe I'm stupid.

\Although I guess stupid people never do


----------



## Runefox (Jan 12, 2011)

Ricky said:


> I'm not sure what kind of "web development" you do that doesn't require JavaScript but that sounds more like "web design" to me.


Honestly? I'm not sure what kind of "web development" you do that relies so readily on Javascript that server-side functions are secondary. That sounds like "web design" to me.



> ...so I think it's a really naive and cocky to say it is worthless.


I didn't say it was. When did I say it was? I never said it was.



> The prototype framework


... Is 160KB, which is HUGE. You don't want images that big on a website on most days, much less Javascript, which delays the loading of the page until it's been downloaded unless you're not a complete retard and pop it into the end of the page instead of the head tag, but I don't see many people bothering with that. Yes, it's cached, but it's still pretty damned huge. And before you start saying "BUT RUNEFOX EVERYBODY HAS BROADBAND 160KB IS NOTHING" you have to realize that 1) that isn't true, 2) 160KB per-viewer runs up to 160MB by the time you get a thousand unique hits, and that's pretty significant on the server side, and 3) for each external library you load, there's an extra connection required to the server, which at around 12 (this includes the HTML, CSS, images and all other external media as well) starts to slow down the page rendering and introduces significant overhead just for the TCP requests alone. All of that adds up, which is why minimizing the number of requests made is a priority for a good web developer (or web _designer_, too), and being lazy about it and hoping nobody cares isn't really the answer. And the same goes for...



> I'm aware you can reformat images but I don't really want to get in a conversation with you about code optimization since you basically said you don't even use JS.


Pfft. A less bloated site is more responsive and less bandwidth-hungry than one laden with Javascript libraries that are usually only used for fancy effects. If you'll notice, Google doesn't at all RELY upon Javascript/AJAX (even Google Maps' API can spit out static images if Javascript support is missing), and even a text browser like Lynx can use most of its services just fine. The whole point behind it isn't to replace functionality but extend it. "Rich applications" are at their cores very much not only reliant on Javascript, but also on a complex server-side codebase, for which the Javascript/AJAX layer acts as nothing more than an interface, and for most applications, you don't even need that. A website is a concept designed to convey information. That is the primary goal of any website. Javascript/AJAX can enhance the delivery of that information, but is not now, nor will it ever be (and nor should it be) the pillar of web design.

I do USE JS. I don't code it very often because I rarely absolutely need it. Why use Javascript for menus when I can use CSS instead, which is faster both in rendering speed and terms of bandwidth usage versus loading a whole library for a few functions? Why use Javascript for silly transitions and highlights when it's both unnecessary and gaudy? Sure, things like AJAX for search and slideshows is nice if you need them or if your site isn't serving anything worthwhile, but for example you probably won't see any of that bullshit on a government website. Sites that actually need to convey information. Sites that you seem to look down on, perhaps because they aren't on the bleeding edge and loaded down with substantial amounts of bullshit.

Also, you don't optimize your images? Damn, I can't imagine all the PNG32's you've got slapped around.



> I work on core RIA/cloud development.


Yay, catchphrases! Well, you must be proud of yourself doing... Whatever it is you're doing, for whoever it is you're doing it for, if anything and anyone. I, like Aden, like to do my homework and do things the right way - To me, that means the leanest, most efficient way possible, making extensive use of JS/CSS suturing and minification (CSS on top, JS down below), CSS sprites to replace simple images and repeating images, using compliant HTML/CSS, and diligently ensuring that any Javascript I use is for things that aren't essential. I'll admit that as far as JS goes, I'm more likely to go find something that's already been written and modify it to suit. I'll admit, and have admitted, that I don't generally write Javascript. However, I do know that it is stupidly easy to use libraries like jQuery because they generally do all the work and you really only need to add a line of code here or there to make something happen. Yes, this is very powerful, but I would never consider it absolutely necessary any more than I would consider Flash or Java, for all the things THEY can do, absolutely necessary.

At any rate, I think that's enough sabre-rattling. I've posted my recommendations for the site in addition to this argument, so hopefully with a little of all of our advice this site will go a little further towards being done.


----------

