MidiMagic 579 Nearly a Senior Poster

Call the function like this:

resultValue = myFunction(arg1, arg2. arg3);

Put a return statement in the function as the last statement:

function myFunction(valu1, valu2, valu3){
  var theAnswer;

  ...

  theAnswer =  [I]your last calculation[/I];
  return theAnswer;
};
MidiMagic 579 Nearly a Senior Poster

Just put a -1 in for the selection variable before starting the loop (which will set it to a value from 0 to one less than the number of buttons if a button is clicked). Treat a no-answer like a wrong answer.

MidiMagic 579 Nearly a Senior Poster

I'll take late 1950s to mid 1960s technology over both:

- Phonograph records have a much longer shelf life than either tape or digital storage. The Library of Congress has chosen microgroove 78 rpm records to store audio archives on. And I have records dating back to 1903 that show no signs of deterioration, other than having been played on acoustic players with very high tracking force.

- There is, with a few minor variations, one single standard for phonograph records. No major upgrades, no incompatible format changes, no competing platforms vying for consumer attention with incompatible products. With a few rare exceptions (mostly records larger than 12"), my favorite record changer can play any disc record made from 1889 until now. No modern format can boast that kind of compatibility, because there are always idiots wanting to "improve" them with incompatible changes.

- If minor damage occurs to the phonograph record, it still plays, with a little added noise. Digital recordings refuse to play past the point of damage. And large parts of the recording are ruined when a tape jams.

- A late 1950s record player and radio can survive an electromagnetic pulse. Given a power source, it would be the only source of music left after an atomic war. All digital players and all transistorized and integrated circuit players will be destroyed. Of course, with modern equipment, no radio stations will survive.

- Likewise, the only TV sets that work would be …

MidiMagic 579 Nearly a Senior Poster

Nobody can have a house like that. Government won't allow it.

MidiMagic 579 Nearly a Senior Poster

The world ended for me when Windows replaced DOS, and my wife left me for an alien.

MidiMagic 579 Nearly a Senior Poster

I saw all of those in a clipping service I used to receive. They are real.

More stupidity that happened in and near the town I live in:

- A nearby town has an ordinance restricting the colors businesses can be painted to a short list of certain "antique" colors.

- The city I live in has an ordinance that requires that at least 1 percent of the tax revenue must be wasted on art.

- A man with a "Darwin" fish and a "Veterans against Bush" bumper sticker on his car refuses to accept the fact that the road he drives on to an from work has become an expressway. Instead of taking the right-hand exit ramp that curves around to be the left turn he wants to make, he drives beyond the interchange, makes a U-Turn in a place reserved for police U-turns, and then makes a right exit from the lanes going the other way. Police have stopped him several times.

- A drunk driver knocked on the door of a state police post and asked for a room. The Holiday Inn is next door.

- A marijuana grower called police and said that a homicidal bush was chasing him. He asked police to search the house for the bush. They found 55 pot plants and jars labeled with different kinds of pot.

- Someone from here called in a threat to the NCAA headquarters demanding that the cheerleaders show …

MidiMagic 579 Nearly a Senior Poster

The only thing such technology should be used for is replacement of damaged parts.

MidiMagic 579 Nearly a Senior Poster

Maybe you need to let Opera do the updates. There are security holes in older versions of browsers which sometimes cause certain sites to block upload access.

Some firewalls also block specific sites or hosts. This would be up to the administrator.

MidiMagic 579 Nearly a Senior Poster

Several possibilities:

- Did they start charging for this?

- Is your file space full?

- Did they change the type of protocol for FTP?

- Is the server blocking certain file types (such as .mp3)?

- Is upload moderated? If so, your files might contain prohibited material.

MidiMagic 579 Nearly a Senior Poster

Note that those four attributes can be overridden by browser settings.

For accessibility reasons, browsers can set constant values for the colors of links and the background. Your styles will be overridden if those settings are active.

All web designers should realize that these settings can be made, and not play too much with link colors.

MidiMagic 579 Nearly a Senior Poster

Can you put some text boxes out to the sides, and connect them with key letters (e.g., box D) to the select boxes?

MidiMagic 579 Nearly a Senior Poster

That works in FF for me - and IE.

If it doesn't work, look for a syntax error.

MidiMagic 579 Nearly a Senior Poster

You have to use a for loop to scan each group of radio buttons to find out which one has the attribute "checked" being true. Use the index of the loop as the value of the radio button found checked.

Then compare the values checked with the correct values. If the value is correct, add its worth to the score.

put the whole address of the text box on the left side of an assignment to put the score in the text box.

MidiMagic 579 Nearly a Senior Poster

The Z index is also not totally implemented yet in a universal way that works on all browsers.

You need to either open an entirely new window (taking focus away from the stuff on the existing window) or make sure where you open the popup has no links under it.

MidiMagic 579 Nearly a Senior Poster

That syntax is necessary only if you are accessing the form using element numbers, variables containing the form or element names, or getElementByName.

None of my books on JavaScript show it for an element address not using variables. That is only one of many valid ways to address an element.

And it definitely does NOT work for addressing radio buttons, where you have to have an address of the syntax:

document.forms.myform.rabutton.checked

Is the W3C now deprecating JavaScript usage too?

MidiMagic 579 Nearly a Senior Poster

You probably forgot to encode a quote as ".

MidiMagic 579 Nearly a Senior Poster

Where is this script located in your code?

It must be below the place where the images are loaded, or the script will run before the images load (and it won't find any).

It's also possible that your browser has settings to prohibit recursive functions (It's a common worm propagation method).

tefflox commented: very nice, friendly, and patient(!) +2
MidiMagic 579 Nearly a Senior Poster

Actually, the firewall we have where I teach stops IE and FF from doing scripts.

IE is certainly that retarded. Every time it upgrades, it changes my security settings back to standard. It always marks DaniWeb as an unknown site.

JavaScript is not needed to post, but to use the dropdown menus. I didn't say it did affect the ability to post.

But browser security settings can affect the ability to post.

MidiMagic 579 Nearly a Senior Poster

Hi, I have taken the following code from youtube. As it is, without the function wrapper, it work in the address bar, tho I would like to modify it and call it to operate in one of my own pages. I need help to figure out how this can be done.

I took it apart to see how it works:

function gyrate() {
R=0;
x1=.1;
y1=.05;
x2=.25;
y2=.24;
x3=1.6;
y3=.24;
x4=300;
y4=200;
x5=300;
y5=200;
DI=document.images;
DIL=DI.length;

function A(){
  for(i=0; i-DIL; i++){
    DIS=DI[ i ].style;
    DIS.position='absolute'; 
    DIS.left=Math.sin (R*x1+i*x2+x3)*x4+x5;
    DIS.top=Math.cos(R*y1+i*y2+y3 )*y4+y5;
  };
  R++;
};

setInterval('A()',5);
void(0);
};

The main caveat is that you not use any of these variables elsewhere in your code. It will move all of the images already on the page.

The x4, y4, x5, and y5 values may have to be adjusted to fit your particular images.

MidiMagic 579 Nearly a Senior Poster

I just changed it. Look again.

MidiMagic 579 Nearly a Senior Poster

Use ClearTimeout(t) to cancel a setTimeout event before it activates. The t is the variable you set in the t = setTimeout() call. For your purpose, this t must be a global variable.

But note this. You resetting the t in the second statement destroyed your ability to prevent the first one from executing. You need a separate variable and a separate clearTimeout for each setTimeout timer you start. And using the var statement in the function call destroyed the ability to cancel the timer anywhere outside the calling function mouseOver().

Your code may happen to work on your browser, but it is definitely nonstandard. It will fail on many browsers, and will probably fail on all browsers in the near future, as they become more standards-compliant.

I would write it this way:

// global variables
var t1, t2, t3;

function yelgreen(){
  document.b1.src='yellow_green.gif;
};

function redgreen(){
  document.b1.src='red_green.gif;
};

function greengreen(){
  document.b1.src='green_green.gif;
};

function mouseOver() {
  t1 = setTimeout("yelgreen()", 300);
  t2 = setTimeout("redgreen()", 2700);
};

function mouseOut() {
  clearTimeout(t1);
  clearTimeout(t2);
  t3 = setTimeout("greengreen()", 300);
};
MidiMagic 579 Nearly a Senior Poster

That might depend on who your ISP is. I get a free Geocities website with my AT&T service.

Finding the "best" web provider is like choosing a car. Everyone has a different idea of what "best" is.

MidiMagic 579 Nearly a Senior Poster

It is entirely up to your web host company whether or not you can have a blog. If you can have it, they provide the software (and might charge for it).

MidiMagic 579 Nearly a Senior Poster

Whether or not to clear fields is a setting.

MidiMagic 579 Nearly a Senior Poster

That is correct. The JS file is not part of the source being rendered.

MidiMagic 579 Nearly a Senior Poster

I don't think you are using setTimeout correctly.

The setTtimeout function wants a function call as a parameter, not a statement or an object. It delays the calling of that function, but does not delay any of the statements after the call. You are trying to call a statement as a function. IE might try to do something anyway, but it is a nonstandard kludge.

Objects are not only forbidden as parameters to setTimeout, but are also forbidden as parameters to the function that is called.

Call a function with setTimeout, and insert the graphic in that function's code.

MidiMagic 579 Nearly a Senior Poster

Arguments are not passed in function calls in the usual way in on-event attributes. There can't be anything in the parentheses after the function name.

Remember that this part is HTML, not JavaScript. The rules are different.

Also, the syntax is different, because the language must be identified. Example:

onclick="JavaScript:calcalot()"

I know this example works.

The following part means absolutely NOTHING in the HTML part of a web page:

window.document.builder.firstDrop.options[selectedIndex].text

This causes errors in the HTML parsing. You have to place this object inside the JavaScript code, not in the HTML code. Also, selectedIndex is undefined.

Also, don't use HTML comments to hide JavaScript. It causes errors in newer browsers. Use a separate file.

MidiMagic 579 Nearly a Senior Poster

I would have had a separate function call for each button, and operated a stack with the function calls.

MidiMagic 579 Nearly a Senior Poster

Don't!

The b and i tags are scheduled for deprecation. If you use them, the page will have to be changed in the future.

MidiMagic 579 Nearly a Senior Poster

Realize that any user can look at the code and find out the password.

MidiMagic 579 Nearly a Senior Poster

Use input instead of textarea. It can be multiline too.

Then use maxlength="number". Then the user can't enter any more characters than number.

MidiMagic 579 Nearly a Senior Poster

If it were in the form of .95 instead of 95%, you could use parseFloat(string) instead.

The main troubles with eval are a long run time and the possibility of evaluating malicious strings entered by a user.

MidiMagic 579 Nearly a Senior Poster

This is an area where there is much incompatibility.

The values pageX and pageY are part of the Mozilla set of properties, not the W3C standard DOM properties. IE doesn't know them.

Fortunately for me (I hate those popups), but unfortunately for everyone else, there is no agreement between IE and Mozilla here. I don't understand why everyone loves these maddening popup devices. They are NOT dyslexic-accessible.

The W3C standard DOM reports the mouse locations with clientX and clientY. The problem is that these do not take document scrolling into account, but just use the browser window location.

MidiMagic 579 Nearly a Senior Poster

You need to put quote marks around the attributes "text" and "total_price".

You need to read the two values for price and quantity. Then you need to find the product. Finally, you must put the answer into the form:

var price, quantity;

price = document.forms.nameOfForm.total_price.value;
quantity = document.forms.nameOfForm.quan_ordered.value;
revenue = price * quantity;
document.forms.nameOfForm.part_revenue.value = revenue;
MidiMagic 579 Nearly a Senior Poster

I do not like the line numbers. It makes it impossible to test the code someone posts without extensive editing.

MidiMagic 579 Nearly a Senior Poster

It might be that the robotic logins are triggering a security flag (they should).

Did you use some character besides letters and numbers. If so, a software upgrade might have invalidated that character for use in a password.

Stupid question: Is your caps lock key on?

MidiMagic 579 Nearly a Senior Poster

What kind of bureaucratic clown requires you to keep records on registration attempts that are not completed? Sounds like either government (too nosy) or some pencil and bean counting red-tapeworm with nothing else to do.

MidiMagic 579 Nearly a Senior Poster

I can tell you why the dropdowns are not working at school. A firewall installed to protect school computers from malicious software is stopping scripts before they get to the computer.

Maybe Opera upgraded itself. In doing so, it may have added a script blocker, or a new set of security settings. Or you might have accidentally changed security settings while doing something else.

Another possibility is that your ISP made changes, such as installing a firewall.

joshSCH commented: omfg.. add this to the long list of idiotic posts by midimagic -2
Sturm commented: Feeling retarded today? +0
MidiMagic 579 Nearly a Senior Poster

This is a multimedia forum, not a Java forum.

What do you need to know about Corel Draw. I am an expert.

You can PM me, but bear in mind that my job is intense at times, and lets me log in only about once a week.

MidiMagic 579 Nearly a Senior Poster

What's the filename? The extension will tell me what program to open it with.

If you changed the file extension (the .xxx part of filename.xxx), or put no extension, the file will not open correctly, even if you choose the correct program you made it with.

MidiMagic 579 Nearly a Senior Poster

Those images were made with a program that was written to do mathematical computation of the surfaces of various functions.

MidiMagic 579 Nearly a Senior Poster

First, your website provider must be one that supports server-side scripts. Mine does so - for an extra monthly fee.

Second, you need a database of all registered users on your website's server.

Third, you must write a script in a server-side language to operate the login process.

JavaScript can't do this, because it runs on the client's computer, and can't see the database. Also, the user can copy and read the javascript by saving the web page to his hard disk. So he could read any passwords you hid in the JavaScript.

MidiMagic 579 Nearly a Senior Poster

Something is shoving the whole bottom row of images to the right. The bottom right image (in the red rectangle) is then crashing into the text box, so it is displaced downward.

How are you positioning the images?

Why can't you use one large image?

MidiMagic 579 Nearly a Senior Poster

Why not just use WebShots?

MidiMagic 579 Nearly a Senior Poster

Could this be a problem with different screen resolutions making a mess of absolute and relative rendering?

Either do everything absolute with reference to the same fixed point, or do all of the relative addressing the same way.

MidiMagic 579 Nearly a Senior Poster

It's the usual case if IE making up its own rules, instead of following the standard.

IE renders a block object of a defined size by putting the margin, border, and padding INSIDE the defined size.

FF renders a block object of a defined size by putting the margin, border, and padding OUTSIDE the defined size.

The only way to get both to work the same is to nest divs, one with the defined size, and the other with the margin, border, and padding you want. Nest them with the margin, border, and padding div on the side (inside or outside) of the defined size div that you want it on.

Set the margins, borders, and padding of the image itself to 0.

MidiMagic 579 Nearly a Senior Poster

If the price is a price that changes daily (such as gasoline) and is stored on your server, JavaScript can't do the job. You need a server-side script.

If the price varies with the quantity ordered, then you need a script that reads the quantity, looks the price up in an array (indexed by the quantity ordered) and then display it in a text box.

MidiMagic 579 Nearly a Senior Poster

How are you addressing it from the HTML page?

If you addressed it with website absolute addressing, the computer running the version on CD won't be able to find the file.

If you addressed it from the C: drive, the computer running the version on CD (the D: drive) won't be able to find the file.

If the HTML is in one folder and the JS is in another folder, it won't work. The method needed to address this on a website is different from the method needed to address this on a local disk on the computer browsing it.

To make it work reliably on both a website and a CD, both files must be in the SAME folder, and only the filename must appear in the script tag call.

I run JS from CDs and it works fine.

MidiMagic 579 Nearly a Senior Poster

Another trick would be to load the full size images and render them small.

If I am looking at your page, I would very much prefer that the images stay larger all the time. I hate jumpy things happening when the mouse goes over something. They usually make me hit my back button immediately.

And it's worse if the expanded image from one mouseover image covers another one, which is the one I want. If I have to do a lot of jiggerrymousery to get to the one I want, I just leave instead.

MidiMagic 579 Nearly a Senior Poster

Please clarify what you are trying to do.