|
noapparentfunction posted:I have a relatively simple slider code on this test page I uploaded. It uses jQuery, but my only problem with this premade application is that it uses those rounded browser buttons to operate. Is there a way to convert these to standard links, preferably ones that use images? I think you could use an onClick=function() on pretty much any HTML element instead of checking each of the buttons to see if they're clicked.
|
# ¿ May 22, 2009 17:29 |
|
|
# ¿ Apr 29, 2024 06:55 |
|
Avenging Dentist posted:A-are you seriously doing validation on the client side? Seems fine to me if it's there to complement existing server validation.
|
# ¿ Jul 7, 2009 21:50 |
|
I recommend that you not bother trying to do that yourself and instead use jQuery with the validation plugin. It's dead simple and looks impressive on the page, too.
|
# ¿ Oct 11, 2009 18:55 |
|
Soks posted:Would there be a way to emulate additional onscroll events if the scroll bar was made in Java or something? Just make the page a giant Java applet.
|
# ¿ Nov 25, 2009 21:33 |
|
Soks posted:Is there a way for Java Script to get the entire length of the page If you're thinking what I think you're thinking, then just use percentages instead.
|
# ¿ Nov 25, 2009 21:45 |
|
I've had great success with qtip for jQuery
|
# ¿ Nov 26, 2009 01:18 |
|
I'm trying to keep track of the URL of a frame on my page. Is it possible to do this with JavaScript?php:<? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { alert($("#inside").toString()); }); </script> </head> <frameset cols="100%" noresize="noresize"> <frame id="inside" src="content.php"> </frameset> </html> ?> All I really want is the URL. What should I be doing instead?
|
# ¿ Feb 1, 2010 19:23 |
|
Thanks for posting that; looks like I can just use DOM methods with name instead of id like inside.location
|
# ¿ Feb 1, 2010 20:38 |
|
gently caress it, man. Get jQuery.
|
# ¿ Feb 12, 2010 18:54 |
|
Actually, that SVG mouseover is not working for me in Firefox 3.6 on Linux either.
|
# ¿ Mar 10, 2010 00:06 |
|
It seems to be getting the onmouseover and onmouseout events, but I'm not seeing anything on my screen.code:
|
# ¿ Mar 10, 2010 00:24 |
|
I have some variables that are being treated as undefined, but I don't understand why. I have a JS file included that looks like this code:
code:
|
# ¿ Apr 4, 2010 05:11 |
|
Thanks, Lumpy. That's the explanation I was looking for. I hadn't done any (serious) JS in a couple months and somehow had the idea that everything was a global.
|
# ¿ Apr 4, 2010 15:29 |
|
I think NYT's website does something like that for word definitions when you highlight text. Maybe you could take a peek over there and see what's going on.
|
# ¿ Apr 25, 2010 20:42 |
|
Netbeans has an excellent JS debugger
|
# ¿ Nov 16, 2010 03:34 |
|
Hoo boy, time to implement a coding standard!
|
# ¿ Jan 5, 2011 15:52 |
|
Browser Domination Sado-Masochism
|
# ¿ Apr 5, 2011 16:20 |
|
An infinite loop will stop FF3 in its tracks for a couple minutes iirc...
|
# ¿ Apr 5, 2011 17:05 |
|
It's convenient to blame IE, but code that looks so awkward should be reconsidered!
|
# ¿ Oct 1, 2013 20:47 |
|
Have you written an encryptor in another language? Try doing a line-by-line straightforward port of it to JS. Next, read a book or two on JS and see if you can't go back and do it again with a better understanding of scope and prototypes and perhaps a library like Parallel.js
|
# ¿ Oct 31, 2013 13:52 |
|
When it comes to animation, setTimeout is a bad habit. If you're targeting modern browsers, requestAnimationFrame is a much better option https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame What you're already doing probably works fine, but this is worth investigating when you want to take your animations to the next level.
|
# ¿ Nov 22, 2013 14:26 |
|
"e-12" is scientific notation. It means "x10-12" What you'd expect from real arithmetic is zero, but what you're getting back instead is an extremely small number due to floating point arithmetic. Computers only represent integers as exact values; other numbers are stored as approximations that are close enough for most purposes. http://en.wikipedia.org/wiki/IEEE_floating_point
|
# ¿ Nov 26, 2013 17:19 |
|
You can avoid the recursion problem by handling this inside a for loop. Use jquery's ajax method synchronously and they'll fire one-by-one as many times as you need. This is going to take loving forever, but it sounds like that's out of your hands
|
# ¿ Feb 4, 2014 17:47 |
|
Sounds like something that should be handled server-side. Deal with the form inside your one-page app, then provide a link to another page that serves a file, perhaps? Maybe add a parameter to the file serving page to require a disposable key.
|
# ¿ Mar 18, 2014 21:52 |
|
stoops posted:I did this in php with a preg_split. Is there something like that in javascript? Not sure how to answer the rest of your question from the top of my head, but here's a start on that string split: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split Javascript splits strings with either another string or regex from the same method. It's really nice.
|
# ¿ May 9, 2014 18:45 |
|
Maybe this library would make things simpler? http://craig.is/killing/mice
|
# ¿ Jun 20, 2014 15:10 |
|
The Principles of Object Oriented Javascript is a nice short read that'll teach you a ton. I also second the recommendation of the two books in the last post.
|
# ¿ Aug 14, 2014 15:07 |
|
This thing looks promising: http://spy-js.com/ Does your code do lots of scope traversal? Getting variables from above the current scope is a common source of JS performance problems. You could try making local copies if that's what's happening. Does any of your program iterate over large sets of data that don't need to be processed in any particular order? Running the computations in parallel may help as well: http://adambom.github.io/parallel.js/
|
# ¿ Sep 9, 2014 15:10 |
|
You should all be using IntelliJ, seriously. Worth every penny. Hopefully they'll add the upcoming CLion as an extension and make it the most comprehensive IDE around.
|
# ¿ Sep 9, 2014 21:30 |
|
loquacius posted:I've fooled around with the idea of using JQuery to spit the object's markup into the parent document, but that's not a good solution since the iframe's content comes from a different server That won't work, either, since you can't read the contents of an iframe on another server.
|
# ¿ Nov 5, 2014 23:33 |
|
Two problems: there's line numbers in your JS and the JS was set to run onLoad, but your binding of the behavior is right in the HTML. Binding a function in an attribute only works for functions that are already declared, not tied to the load event, so switching it to <head> solves the problem. You might not understand that second part at this point in your learning, which is perfectly normal.
|
# ¿ Dec 31, 2014 18:11 |
|
An editor with better syntax highlighting would've put some sort of error notification there
|
# ¿ Dec 31, 2014 18:39 |
|
unpacked robinhood posted:How would you go about creating a graph I'm not sure if there's a good off-the-shelf solution for it. It's relatively easy to generate SVG, though, so if you can find the right algorithm you could generate the markup yourself
|
# ¿ May 9, 2018 18:17 |
|
Node is a language/server combo like Python + Gunicorn. You'd need to find a heavy backend framework like Django for Node that has a similar feature.
|
# ¿ May 29, 2018 18:09 |
|
Knifegrab posted:I feel really dumb but I am still confused, can anyone point me to a specific example or something? The repo is private but the repo itself has dependencies that must be npm installed as well. There's an example in the docs: https://docs.npmjs.com/files/package.json#repository
|
# ¿ Jun 18, 2018 21:44 |
|
FSMC posted:I'm writing a browser bookmarklet/extension and have just started using unit tests. Sounds like you've got a problem either selecting the right section of the document or parsing its contents? You could include as part of a your tests a set of copy/pastes of input data that would normally come from the service you're scraping. This is sometimes called a "fixture." Add a couple consts or functions with a couple versions of passing and failing data as appropriate and then write and test the functions that parse it. Testing the fetch code could be harder, but if you've really separated the fetching logic from the parsing logic, there shouldn't be much room for error. I usually say skip the tests that interact with 3rd party services if the rest is solid.
|
# ¿ Sep 2, 2018 01:52 |
|
That selector doesn't appear to be in your markup
|
# ¿ Jan 1, 2019 00:01 |
|
That ought to cover the purely technical answer for the face-value interpretation, but do you mind describing the use case a little more?
|
# ¿ Jan 21, 2019 04:41 |
|
Ah, ok. I was thinking that if the true update needs were indeterminate, it might do better with a websocket instead of xhr polling, but it sounds like that's not the case.
|
# ¿ Jan 21, 2019 15:00 |
|
|
# ¿ Apr 29, 2024 06:55 |
|
Wordpress ends up being pretty slow as an API backend. Each request fires all the same hooks as a full pageload. I've heard of better experiences doing headless Drupal, but I don't really like using CMSes in general myself.
|
# ¿ Apr 26, 2019 23:10 |