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 money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
FateFree
Nov 14, 2003

I am a java developer primarily, and my knowledge of javascript is pretty limited. I've come into a requirement for a project that takes a giant chunk of html (mostly text, a few bold, italic, or underline tags, and images are possible), and instead of displaying it in one page with a long scrollbar, the requirement is to paginate it so that the viewers can click a navigation bar on the bottom (first, next, page 1, 2, 3, .. 10, last etc).

Initially, this requirement was only for a chunk of text, so server side my java code would count characters and lines and line breaks, and break the text into several page objects, which were easy to paginate. However it never felt right because it seemed like this was something a browser was meant to do, and now that html is possible, I can't run the same algorithm because I can't compute the size of the images and i'd have to strip out all the tags and whatnot.

Can you think of a way this may be accomplished with javascript, or should I try to do it with java still? One thing that may be an issue is if the browser will know when to break apart the text in order to paginate it correctly. Any ideas?

Adbot
ADBOT LOVES YOU

FateFree
Nov 14, 2003

Can anyone write me a relatively easy function? Im looking for a method to be called from a textarea that counts the character length, but updates a div with the total count and changes the class if its over a limit.

So for each example youd see a textarea, when you typed something there would be a div with like 0/100, 50/100, 200/100 as you are typing, but it doesnt restrict if you go over the limit, it just changes the css class so it looks red or something, where its green if its under the limit.

FateFree
Nov 14, 2003

Thanks alot lumpy I appreciate it. It works fine in IE but not in FF so im looking into that, but otherwise does just what I wanted.

edit: firefox wanted .textContent instead of innerText

FateFree fucked around with this message at 13:25 on May 13, 2009

FateFree
Nov 14, 2003

sonic bed head posted:

.value should work in both.

Eh that didnt work for either, I think because its not a form field, rather just text.

FateFree
Nov 14, 2003

I'm looking for a solution to a page where I have multiple tasks and categories listed. Each task though has a set of operations attached to it, like complete, delete, edit, move etc. I'm trying to find a good way to show these options maybe via a tooltip after clicking on a settings icon.

I've been looking at Jquery QTip to do it but, has anyone seen an example of something similar elsewhere on the web so I can see how it looks? Every tooltip example I see is usually text, im looking for more of a list of icons/buttons that users can interact with.

FateFree
Nov 14, 2003

Is there a JQuery plugin that comes with cheap ajax capabilities for form submissions? What I really want to do is have a form that traditionally works without javascript and reloads the entire page, but if they have javascript I would love to just stick an id (or several) in a data attribute on the form that tells the plugin what content is going to be updated on the submit, and then basically it could just parse those ids, parse the html content out of the result, and update the sections of the page with results. The server is still going to do all the extra work of returning the entire page but to be honest the performance of that is fine.

Adbot
ADBOT LOVES YOU

FateFree
Nov 14, 2003


Wow how about that. Thanks! I figured the use case might be common enough for other people.. Its like ajax for lazy folks.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply