|
Zoopy posted:I am taking a javascript class online with a really awful teacher and really awful course materials.. I swear to loving god she is asking us to do things she hasn't taught us. Google the following phrases: 1. "javascript get form input value getElementById -ajax" 2. "javascript change form value getElementById -ajax" (Hint, you'll be using 'getElementById()' That should give you plenty of places to learn what you need to do.
|
# ¿ Feb 8, 2009 22:02 |
|
|
# ¿ Apr 23, 2024 22:19 |
|
fletcher posted:Is there any performance difference between using arrays vs. using JSON? Not sure, but since *everything* is an object in javascript, I wouldn't think so.
|
# ¿ Feb 26, 2009 21:04 |
|
supster posted:Not with just Javascript in a browser. Actually, there is using a Mozilla extension, but the very, very limited way it can be used makes it effectively a non-solution.
|
# ¿ Mar 9, 2009 23:23 |
|
G-Dub posted:Does anyone have a guide to creating forward and back buttons in an HTA that definetely works and an example of the implimentation?? I have been struggling to get any of the tutorials I found through Google to work. As a small aside - I haven't set a doctype - will this make a blind bit of difference? Do you even set a doctype for an HTA? Pretty sure every browser comes with those... don't reinvent the wheel, especially since users will *always* use the ones on the browser instead of yours. Also, WTF is an HTA. Why does the internet force people to use buzzwords and abbreviations =( Is that like MS's Adobe AIR or something?
|
# ¿ Mar 11, 2009 06:22 |
|
rotor posted:HTml Application. It's basically a balled up wad of html & scripts (vbscript usually) that looks like an application to the user - sort of like a CHM. I don't think it has fwd & back buttons, hence the question. Ah, OK, so it's like Adobe AIR, but windows-only. I wondered why AIR was never more popular, but the more I thought about it, when you start developing these things(AIR apps and HTMs,) you generally get more complex than "just a web page" and are tracking view states, need to swap objects on screen out, need to write out data to files, have to have more complex error-handling, etc. So many who would find the ease of entry ("hey, you already know HTML and javascript!") are a bit un-prepared / overwhelmed by all the additional stuff they need to code, and those who are prepared for all the extra bits probably just say "gently caress it, I'll write it in C, C#, Java, Objective-C , [INSERT LANGUAGE HERE]" Thanks for the info on HTAs. I actually have a "web" app deployed that is IE-6 only (used internally in a call center) that I frequently wish I could bust out of the browser sandbox a bit. It requires OCX controls, so I couldn't do it in AIR, but this might be the bee's knees.
|
# ¿ Mar 11, 2009 15:34 |
|
Mercator posted:You have absolutely no clue what AIR is. Really? Wow, then I better trash all the AIR apps I've written. It's likely I don't understand what HTAs are, but don't let that stop you from being a douche.
|
# ¿ Mar 11, 2009 16:14 |
|
joojoo2915 posted:
Without seeing the HTML it's impossible to tell if what you are doing is "correct" but if you are getting the value of a SELECT you need to do something along the lines of: code:
Or, use jQuery and do $('#selectID').val();
|
# ¿ Mar 12, 2009 16:36 |
|
Melraidin posted:First guess: define GOGRAIN_XML_URL outside of the if statement, then inside it do not use "var". Right now it looks like you're probably passing "undefined" to buildMovieFromXML as GOGRAIN_XML_URL doesn't exist outside that if statement in your code. Huh? He passes it as an argument before the function ends, and javascript passes by value, not reference, so it's not undefined. Using 'var' twice like that is ugly, but it works in javascript. code:
Lumpy fucked around with this message at 15:19 on Mar 13, 2009 |
# ¿ Mar 13, 2009 15:07 |
|
Sylink posted:Is it possible to dynamically change the size of a canvas in javascript instead of specifying like below? This resized for me, so I'm guessing yes: code:
[EDIT] This made a new one and sized it appropriately: code:
Lumpy fucked around with this message at 04:46 on Apr 2, 2009 |
# ¿ Apr 2, 2009 00:50 |
|
Hi I am a Snake posted:This is a simple question but I cannot figure it out. Please help. What Avenging Dentist said, and here's some good reading on this stuff: http://javascript.crockford.com/private.html
|
# ¿ Apr 7, 2009 06:43 |
|
Kekekela posted:JSLint gives me a "Bad escapement" message on the following line, I'm guessing its something with that which follows the backslash but I suck at regex and can't get it cleaned up, halp: Have you tried the alternate syntax to see if that makes it shut up? code:
|
# ¿ Apr 9, 2009 20:45 |
|
Blackout posted:Hey, I'm back again with another question! code:
|
# ¿ May 7, 2009 23:38 |
|
Crysinth posted:Well, I got a bit more info, so I hope it helps towards actually figuring out a solution. I suspect its your friend's code. Browsers don't randomly ping stuff, and JS can easily deal with ms response times. Make sure your test doesn't start until after the document and DOM fully load, don't do any synchronus stuff while the test is running, and you'll be fine.
|
# ¿ May 8, 2009 01:55 |
|
Blackout posted:That would be really easy, but my situation is a bit different. I've got my function in blah.asp, but I want to call it in multiple spots, passing different parameters. The HTML that the function returns is what I want to create a link to, not the asp page itself. So you want a link under each header, then when clicked, runs blah.asp but produces different HTML based on which header link you clicked: code:
|
# ¿ May 8, 2009 05:11 |
|
FateFree posted: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. Style and Script code:
code:
Lumpy fucked around with this message at 05:56 on May 13, 2009 |
# ¿ May 13, 2009 05:49 |
|
FateFree posted: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. Huh, th's odd, I tested in Safari and Chrome and it worked, assumed it would in FF. Normally I'm not lazy enough to use innerText and do the whole childNode thing.
|
# ¿ May 13, 2009 14:31 |
|
Munkeymon posted:I can't figure out why the result would be i = 0: Because you have i set up as a global. Because you didn't use this or var in front of it. code:
Lumpy fucked around with this message at 23:08 on Jun 2, 2009 |
# ¿ Jun 2, 2009 23:04 |
|
Jreedy88 posted:I have this in my CSS: Set the display to block. Think "none" = invisible, "block" = visible
|
# ¿ Jun 19, 2009 17:30 |
|
Ether Frenzy posted:I'm having trouble amending this javascript form submission to also allow the "Enter" key to submit the form. I'm not that experienced with javascript, so my googling has not been resulting in any successes at inserting the additional elements. First link from a Google for "javascript bind keys" has a pretty good tutorial: http://www.javascriptkit.com/javatutors/javascriptkey.shtml
|
# ¿ Jul 7, 2009 18:52 |
|
Hammerite posted:Full disclosure - I posted this in the Web Design & Development small questions thread, but came to the conclusion that it's really more Javascript and I will be more likely to get help with it here. Hence I'm reposting it. Perhaps make your code > 94? It's possible the ajax return happens when it's false on unload, and since false is not the string 95, you get a background change. This is my pre-coffee first guess, so it's probably wrong. I'll look again in an hour when I wake up. Also thank's for the reminder as to how ugly "plain" ajax code is. I don't miss writing stuff like that at all. /me gives jQuery a hug.
|
# ¿ Jul 9, 2009 15:50 |
|
FedEx posted:I'm running an old javascript menu I had lying around my computer for years. I wanted the script centered, so modified it to include a margin-left and changed its absolute position which works fine in chrome, opera, IE but breaks in firefox which puts the menu on the far left of the screen Guys, something is wrong with my car engine, it's sort of making this noise... I put a clamp on that thing, but now the other hose is lose: what should I do to fix it?
|
# ¿ Jul 12, 2009 21:00 |
|
Hammerite posted:
If you are disconnected form the internet, you cannot get a "good" ready state change event from your function, so the checking code will never run.
|
# ¿ Jul 12, 2009 21:02 |
|
diadem posted:How do you detect if the current window has focus? Listen for the onFocus event / onBlur and set a flag. Here's a poor example that uses a global variable and the not preferred way of doing event handlers to give you the gist: code:
|
# ¿ Jul 21, 2009 16:54 |
|
Bhaal posted:Had a fun time today trying to find the bug in my code until I finally distilled the problem down to the following abstraction: This is a very, very very common problem. What's happening in your first example script is when you do an onchange, the current value of key is looked up. After your loop runs, the value of key will always be 'oranges' The second example uses a closure to stop that from happening. If you use a library like jQuery, it will do all the dirty work for you. code:
|
# ¿ Sep 23, 2009 02:08 |
|
CT2049 posted:I'm currently working on a page in which that has a drop down menu similar to an option element. However, I need more than just text for each option so I'm using a div that I make appear and disappear. I've got the appearing working correctly, but I'm not sure how to make it disappear when I click anywhere on the page. Does anyone how I can accomplish this? when you show your DIV, add a click hander to the document, check to see if the click was in your DIV, and if not, hide. When you hide, remove the click handler as well, so it's not checking when it doesn't need to.
|
# ¿ Oct 13, 2009 17:32 |
|
Is navigating to someone's profile done via AJAX by the site, so there's no page load?
|
# ¿ Oct 22, 2009 15:17 |
|
Soks posted:[ choppy in Safari ] It was quite smooth in Safari for me. 4.0.4 on OS X 10.6.2
|
# ¿ Nov 24, 2009 20:21 |
|
awdio posted:For some reason, I cannot get a span to display when I'm passing the name of it using selectedIndex. If I simply use onChange="Show_Stuff(this.display4)" it works. Off the top of my head, but this should work: code:
body: code:
|
# ¿ Dec 1, 2009 22:00 |
|
awdio posted:Tried that... still nothing. I'm just trying to pass an options value. From what you mentioned above, shouldn't it be option.value? this.options[this.selectedIndex].value Really, just google "get selected value with javascript"
|
# ¿ Dec 4, 2009 20:22 |
|
peepsalot posted:Your Show_Stuff function expects a DOM element parameter to be passed to it, and you're passing it the value attribute of an element(a string). Yup, that's why in the code I posted for him before I used getElementById to make a DOM object. I even put in console logging for him.
|
# ¿ Dec 4, 2009 23:22 |
|
NANERPUSS posted:So I'm going to assume you guys have heard of the Google AJAX Feed API right? Pretty killer tool, but I'm having a small issue that really isnt that important, but I'd love to fix it soon. Modify the plugin to select .gfg-listentry instead of #one ?
|
# ¿ Dec 18, 2009 15:36 |
|
Haystack posted:Could someone explain this code pattern to me? This says it much better than I can. Basically the set of parenthesis around the function don't actually do anything... the second set just tell the function to execute (much like String.indexOf will return the method, and String.indexOf() will actually run it.)
|
# ¿ Dec 29, 2009 16:21 |
|
usingpond posted:I was considering a new thread for this, but it doesn't really deserve one on second thought. Anyway, I do a bit of Javascript, and I currently use Prototype, with scriptaculous for UI effects. You will wonder why you used prototype for so long.
|
# ¿ Dec 31, 2009 03:42 |
|
JasonV posted:I'm just starting out learning some Javascript, and run into this problem that's just driving me nuts: Wherever you are learning your js from, stop. As said before, use jQuery, or if you want to do it the "hard" way to learn the under the hood stuff, learn HTML first.
|
# ¿ Feb 12, 2010 23:33 |
|
Boring posted:trying to make a slidedown menu type thing, using this: You are setting the text() of the element, which will treat whatever you stick in there as... text! You want to set the html() of the element, which will treat what you stick in there as HTML, and show the image. Also, you are using multiple elements with the same ID. This makes baby web-developer jesus cry. Don't do that. Lumpy fucked around with this message at 17:03 on Mar 9, 2010 |
# ¿ Mar 9, 2010 16:54 |
|
Boring posted:awesome thanks! got it working. you completely rule. Your reset.css should be fixing any padding issues. If you aren't using a reseet.css, shame on you. http://meyerweb.com/eric/tools/css/reset/ Since you are adding elements w/ javascript, that could be why it doesn't show up right in any WYSIWYG "preview" pane or whatever.. I could be wrong though, since I have not used Dreamweaver.
|
# ¿ Mar 9, 2010 19:30 |
|
How are people doing localization with external .js files? A couple ideas that occur to me are: 1) include different message file(s) based on session (or whatever) settings php:<? switch( $_SESSION['lang'] ) { case 'en': echo '<script src="English.Messages.js"></script>'; break; case 'es': echo '<script src="Spanish.Messages.js"></script>'; break; //(etc.) } ?> code:
|
# ¿ Mar 10, 2010 16:57 |
|
smug forum rear end in a top hat posted:Can anyone recommend a good Javascript book? That would greatly depend on your pre-existing knowledge of JS, and experience with other languages and object oriented programing in general. Are you just starting out? Have 12 years of Java development experience?
|
# ¿ Mar 11, 2010 19:50 |
|
ChrizpG posted:I am trying to get a small box to appear on mouseover of a rectangular area in an image. Actually, multiple areas with an individualized box for each. The boxes are going to have some links and maybe an image or something. The box should "hold" after your mouseover to give you time to move your cursor into the box, which should stay up until you move out of the box. Make an imagemap and tie js events to it.
|
# ¿ Mar 25, 2010 05:27 |
|
|
# ¿ Apr 23, 2024 22:19 |
|
rt4 posted:I have some variables that are being treated as undefined, but I don't understand why. Your image var is scoped to the anonymous function. You probably want to do something like this: code:
Lumpy fucked around with this message at 15:16 on Apr 4, 2010 |
# ¿ Apr 4, 2010 15:09 |