Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #1K
~21.4K People Reached
About Me

Suddenly discovered that JavaScript is a great language! Thanks, Douglas Crockford.

Interests
Hiking, skiing, cycling, kayaking, piano playing, cooking
PC Specs
1 Windows XP Pro 1 Linux KDE
Favorite Forums

67 Posted Topics

Member Avatar for Violet_82

Flash is not supported on most Apples. Otherwise it's the best option. Movies are one alternative. Another is JavaScript. With JS you can fade one image in while another fades out, giving an animated effect. You can animate styles. Animating left and/or top moves any DOM element. jQuery's 'animate()' method …

Member Avatar for Violet_82
0
504
Member Avatar for omaiaa0p

Design issue. You can get code like this to work, but it's devilish hard and will probably find another bug for you tomorrow. You are trying to process content in a loop while also modifying the content. Do one job, then the other. 1) process all rows. (Get the total, …

Member Avatar for MartinRinehart
0
239
Member Avatar for triumphost

That would be cross-browser scripting (XSS - one page's JavaScript manipulating a site from another source) and it should not be allowed, for very good security reasons. Back up, rethink and redesign. And, sorry, I know you didn't want to hear this.

Member Avatar for triumphost
0
146
Member Avatar for Biglis35

Before you implement Airshow's excellent advice, back up to step 0. On your hard drive, create a folder. Let's say you're using Windows. Try C:\barcoscon. Place this code in that folder in a file named "index.html". (When you log onto any site on the web you are opening "index.html". Sign …

Member Avatar for MartinRinehart
0
250
Member Avatar for mcuk

Your 'load' element is first given a 'position: fixed;' and then 'position: absolute;'. 'fixed' is a position on screen, screen coordinates. 'absolute' is a position within its enclosing element. If the enclosing element is 'document.body' this could be scrolled off the screen. When one style overrides an earlier style, like …

Member Avatar for MartinRinehart
0
322
Member Avatar for opjjuly

Probably badly written JavaScript running into naming conflicts. With one effect at a time, do a global change (MUST match case, whole words only) of one var name at a time from something simple, like 'a' to something unique, like 'my_876_a'. Do a quick check after each change. Warning: Murphy's …

Member Avatar for MartinRinehart
0
184
Member Avatar for buzzykerbox
Member Avatar for narekm

If you write one long line that does everything it's impossible to debug, even with a good tool like Firebug. Break it up: [code] //bad: doc.getEById( 'id here' ).value += doc.getAnotherEById.value + ...; // try: var ta = document.getElementById( 'textarea' ); alert( ta ); var ta_value = ta.value; alert( ta_value); …

Member Avatar for MartinRinehart
0
166
Member Avatar for hubbrdw

Do not write JavaScript in a string assigned to an 'onclick' property. Write it in a function in a <script> area and assign the function, thusly: [code] ... <body> ... <div id='an_id'> <!-- doesn't have to be a div, any element is OK --> ... <script type='text/JavaScript'> var some_elem = …

Member Avatar for MartinRinehart
0
165
Member Avatar for tozenter

I cannot read your code. I doubt anyone else can. The best JavaScript conventions published are by Crockford. Try googling "crockford javascript conventions" and following his advice. The name "thechosenone" is a superb example of why you should always use camelCase (theChoseNone or is it theChosenOne?) or lower_and_upper (the_chose_none or …

Member Avatar for MartinRinehart
0
221
Member Avatar for Roancho khan
Member Avatar for MartinRinehart
0
69
Member Avatar for Roancho khan
Member Avatar for saad_sinpk

Hey, friend, that's way too much code! Hire a consultant to go that way. For a little friendly, free support, narrow the issue down to maybe a dozen lines and a well-focused question. In general, use a div around each neighborhood and assign an 'onclick' handler to the div. Code …

Member Avatar for super9876
0
114
Member Avatar for PriyalRao
Member Avatar for PriyalRao
0
261
Member Avatar for GeekDude
Member Avatar for Troy III
0
5K
Member Avatar for anupama385
Member Avatar for Violet_82

Let's have an example. [code] function double( x ) { return 2 * x; } // 'x' is a placeholder, waiting for a value y = double( 23 ); // y === 46 [/code] When you put the 'double()' function into service, its parameter, 'x', is given a value. That …

Member Avatar for Violet_82
0
235
Member Avatar for dz.bookerz

You actually want "help for JavaScript", not Java. If you want someone to write the code for you, this forum might not be the best choice. Here is a good place to get help with code you are writing. This job would be a good first JavaScript program. I'd make …

Member Avatar for MartinRinehart
0
141
Member Avatar for phorce

Ask Goog for some help with "CSS box model". Then ask yourself what you mean by "center".

Member Avatar for MartinRinehart
0
93
Member Avatar for Psyho

Tables are much easier to build with 'insertRow()" and "insertCell()". (Yeah, I know. You've done it the hard way and it finally worked! Bravo. But please edit it back to the easy way, now that you know.) As you create your rows/cells, also create a map, a 2d array where …

Member Avatar for MartinRinehart
0
151
Member Avatar for SethHall

What are your goals here? To make it easy for the user? To make it easy for the shipping department? What is the allowable range? For example, could a month of October or less still be valid today? How far in the future should be go? Are dropdowns the best …

Member Avatar for SethHall
0
1K
Member Avatar for Stefan_Lam88

What accordion? Your code or a library? It's certainly possible to click "Go to B" from page A, without destroying page A.

Member Avatar for MartinRinehart
0
119
Member Avatar for Violet_82

Never saw 'return:false' before. Did you mean 'return false' (no colon) or is that something I need to learn about?

Member Avatar for Violet_82
0
229
Member Avatar for gg3l

Not sure it's your problem, but here's a general thought. All CSS measurements MUST have a dimension when they are non-zero. CSS will (theoretically) choke on 'width: 100;'. Therefore, JS will (theoretically) choke on 'xxx.style.width = 600'. However, most browsers accept unlabeled widths for most tags, since most HTML accepts …

Member Avatar for raphie
0
244
Member Avatar for Metophase

Taywin, Your normally superb posts hit a speed bump. "If you want to keep the value ..." perhaps you should attach it as a property to the function, no? [code] function maybe_later() { if ( maybe_later.timeout ) { ... } maybe_later.timeout = setTimeout( ... ); [/code]

Member Avatar for Taywin
0
252
Member Avatar for Frankey

jQuery's 'parseJSON()' has the advantage of not using 'eval()' for those browsers that support a 'parseJSON()' function. Of course, that excludes you know who, so this isn't yet a big advantage. It is safe to 'eval()' JSON if your code creates the string to 'eval()'. It's an invitation to hackers …

Member Avatar for MartinRinehart
0
100
Member Avatar for Revlis

And your question? Without knowing where you are stumped, do try to ignore all the advice about using image software, not browsers, to size your images. Most browsers today can effectively resize photos even by rather small amounts. I just created an animation where a detail of the Sistine chapel …

Member Avatar for Revlis
0
2K
Member Avatar for gyno

Gosh. You should get my book! (Except that it's not published, yet. You'll probably be an ace before it is ready.) Absent that, look for a more modern tutorial. IE9 is NOT a good learning browser. Chrome is very good for learning, as are Firefox and Opera. If you're going …

Member Avatar for jmichae3
0
123
Member Avatar for Aksel

There are a thousand lightbox functions on the web. Google and try some. If you can't find one you like, get back to us here. This is pretty simple JavaScripting.

Member Avatar for MartinRinehart
0
140
Member Avatar for ChaseRLewis

You're right. Something strange is happening. Post again with a lot more specifics on what you are using. In JavaScript 'typeof' is a unary operator, like the hyphen used to negate a number or the exclamation point used as a logical "not" operator. Saying "typeof(foo)" is identical to "typeof foo" …

Member Avatar for ChaseRLewis
0
107
Member Avatar for spsree

You forgot to ask your question. Your code looks OK so far. While you think about the question, take the <script> out of the <head> and put it at the end of the <body>. (See Souders [i]High Performance Web Sites[/i].)

Member Avatar for MartinRinehart
0
69
Member Avatar for hiyatran

Yahoo guru (now Google guru) Steve Souders, in [I]High Performance[/I] recommends always placing your script at the end of the body section. I'm sure he knows more than almost anyone about script performance. In addition to the performance, it also fixes this bug as pointed out in the above reply. …

Member Avatar for MartinRinehart
0
91
Member Avatar for jshenn

Your post is missing some code. If you've not found the bug yet, post the part of the code that does the replace. Sounds easy.

Member Avatar for jshenn
0
163
Member Avatar for gujinni

<vent>Tell your instructor that at least one highly experienced coder thinks he should be fired. Asking students to code a bubble (or other) sort is absurd. Sort algorithms are non-trivial but fully explored. In any modern language you call a 'sort()' method and you will never have to code a …

Member Avatar for MartinRinehart
0
152
Member Avatar for aldm
Member Avatar for MartinRinehart
0
240
Member Avatar for RazorRamon

1) Move your script from the <head> to the bottom of the <body>. Then you won't need '$(...).ready'. See Souders book [I]High Performance Web Sites[/I] if you need more reasons. 2) Don't use jQuery if you don't have to. Hiding/showing a div is simply a matter of switching it's 'display' …

Member Avatar for stbuchok
0
196
Member Avatar for asif49

Why is it you aren't just incrementing the size? 'setTimeout()' for zero millis?

Member Avatar for asif49
0
178
Member Avatar for Monster Killer

Google again. See the "getUTCxxx" methods. You are almost in business! Next topic: that's very nice code. Clean, readable and not likely to ever be a source of bugs. Couple suggestions: 1) Don't concat "getElementById" with other operations. Better: foo = document.getElementById( ... ); foo.innerHTML = ...; 2) Use an …

Member Avatar for Taywin
0
187
Member Avatar for anandhikrishnan

I have tried to get double click/long click in other browsers and never got it to work right across browsers. You just won't get the control you need until JS has decent threads. (About which Eich says, "Over my dead body!" so don't hold your breath.) These days I redesign …

Member Avatar for MartinRinehart
0
124
Member Avatar for masocha

Using 'a:visited' you can set the style for visited links: [code] /* CSS */ a:visited { background-color: red; } [/code] Is that enough?

Member Avatar for MartinRinehart
0
1K
Member Avatar for raviaaaa

Raviaaa, That's a massive amount of code. Do you want to hire a consultant to work through it, or can you narrow it down so we can discuss a specific issue?

Member Avatar for MartinRinehart
0
436
Member Avatar for matt.clark.228

Here's a QD function (untested, typos included no extra charge): [code] function show_briefly( div2show, millis2show_it ) { div2show.style.display = 'block'; // make it visible function hide() { div2show.style.display = 'none'; } setTimeout( hide, millis2show_it ); } [/code] That assumes that your help message is in 'div2show' and that the div …

Member Avatar for MartinRinehart
0
153
Member Avatar for davy_yg

You are the second person this week being whacked by this CSS blunder. If an element is transparent, everything attached to the element will be transparent. You want opaque text on a transparent background. The only way to do this is to have two elements. The first element will be …

Member Avatar for MartinRinehart
0
187
Member Avatar for n3xtgen
Member Avatar for extemer
0
218
Member Avatar for Ellyna89

What, in English (not code) are you doing? Also, use functions to call 'setTimeout( function_not_string, millis )' [code] function do_foo() { /* does something here */ } // wrong: setTimeout( 'do_foo()', 1000 ); //string is bad // right: setTimeout( do_foo, 1000 ); // function is good [/code] The function will …

Member Avatar for MartinRinehart
0
107
Member Avatar for hbk_star2006

You have to post some code to get help with an issue like this. Before you do, please be more specific about the problem, and take a very good look to see that you don't have two variables with the same name. If you do, rename one of them and …

Member Avatar for MartinRinehart
0
184
Member Avatar for xtra333

I second Taywin's motion. At the bottom of "foo.js" I always place this line: alert( 'foo.js loaded' ); If the alert pops up, you have no avoided several of the ways to screw up a .js file: wrong directory, wrong name, syntax error in file, ... Then you comment out …

Member Avatar for MartinRinehart
0
72
Member Avatar for alanlee9898

The previous post was right. Using the same ID for two (or more) DOM elements is an error. Unfortunately, it's not the kind of error that reports: "Hey, dummy! You used that ID already! Think up another one!". No such luck. It's an error and it will cause something to …

Member Avatar for alanlee9898
0
184
Member Avatar for Mahesha999

Key codes and char codes are different. Here's a nice little tester: [URL="http://asquare.net/javascript/tests/KeyCode.html"]asquare.net/javascript/tests/KeyCode.html[/URL]

Member Avatar for Taywin
0
668
Member Avatar for extemer

$ - name of several different functions, much abused by libraries. Best known: jQuery, where it is an equivalent to a CSS selector. Assuming that's the one, '$("#amount") selects the DOM element whose ID is "amount". $xxx.keydown - "call me if there is a keystroke while I have focus" keydown( …

Member Avatar for MartinRinehart
0
111

The End.