954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help tweaking some java



Diagnosis Category
Code Set
ICD-9-CM Code






Attachments Java-Code.jpg 116.76KB
StrongOak
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

This is asp and javascript - not Java. Perhaps you would get more help over in those forums, as this one is for Java programming. At a glance though, those extremely long nested switch statements make me cringe.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 
This is asp and javascript - not Java. Perhaps you would get more help over in those forums, as this one is for Java programming. At a glance though, those extremely long nested switch statements make me cringe.


Well I showed the entire page so everyone would know how it relates, the question I have is java related. I am having trouble finding how to edit the java to only run the populate scripts on the 2nd and third boxes once a selection is made.

For example I want it to populate the left box, then when they click the 1st choice it would assign a variable to that selection (lets say 1) then it could run the script to populate the second box by only pulling the data matching 1 and so on in the third box.

Did I explain that ok?

StrongOak
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

JavaScript != Java

You have shown only JavaScript. There is no Java anywhere in that post.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

JavaScript != Java

You have shown only JavaScript. There is no Java anywhere in that post.

Shows my level of newbness on java, I am a vbscipt/asp guy trying to learn some java for client side.

I am open to any code to accomplish what I need.

StrongOak
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

Shows my level of newbness on java, I am a vbscipt/asp guy trying to learn some java for client side.

I am open to any code to accomplish what I need.


You should post this question and code in the Web Development / Javascript forum. As has been pionted out, this forum is for Java questions, which is not the same thing as Javascript.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 
You should post this question and code in the Web Development / Javascript forum. As has been pionted out, this forum is for Java questions, which is not the same thing as Javascript.

Yeah admins already moved it for me.

StrongOak
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

The code I saw is not valid javascript.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 
The code I saw is not valid javascript.

Can you elaborate on that? It is out of a java book with asp intrigrated. If your looking at it from a pure java standpoint look at the second code, which is what the client sees.

StrongOak
Newbie Poster
6 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

Java and JavaScript are two totally different languages. The only common element is the name "Java".

You can't learn JavaScript from a Java book, or Java from a JavaScript book.

The following is NOT valid JavaScript, though it is valid Java.

code = Trim(DataRangeHdr1("code"))
DiagnosisName = DataRangeHdr1("DiagnosisName")
DiagnosisName = (Replace(DiagnosisName,"'"," "))
 
CodeMark = InStr(code,".")


JavaScript requires a semicolon at the end of each statement, except in certain positions (where the semicolon must not appear). Java does not require semicolons except in certain constructions.

Internet Explorer allows some JavaScript statements to work correctly without semicolons, but other browsers do not. So IE cheats. Don't write your code to rely on IE quirks.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

What are you smoking kid?

In Java every statement (unless it is a compound statement) needs to be terminated with a semicolon (compound statements need not be, as they're demarkated by braces which act as terminators).

Your "Java" example looks more like Visual Basic to me.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Then this book I have is trash.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

I did some more investigation, and found out that the only book I have on Java (as opposed to JavaScript) was worth what I paid for it: It was given to me as "surplus materials" at the library fundraiser auction two years ago. Now I know why they got rid of it.

Now that I look at it closer, it seems to be a book on programming tricks using the quirks of one particular interpreter. It's in "cookbook" form. I thought it was a reference book, since the library's reference department had it, and stamped REFERENCE all over it. (Maybe I should have read the preface.)

I am writing an appropriate word across the front cover:

"Void"

It reminds me of an economics book I used to have, which purported to be an econ textbook, but which actually distorted economic theory to advocate socialism.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

Glad you got rid of that book. The content it had was kind of giving us fits... ;-)

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 
Internet Explorer allows some JavaScript statements to work correctly without semicolons, but other browsers do not. So IE cheats. Don't write your code to rely on IE quirks.

IE is correct; according to the 'standard' semicolons after javascript statements are optional. Or, as I just read; 'automatically inserted by the parser when it encounters newlines'. Read the ECMAScript standard document if you like.. javascript is approximately equal to ( and syntatically identical to ) ECMAscript. I'm not sure which ecmascript version corresponds to which JS version, but the semicolon thing has been around since before I saw any javascript. If other browsers aren't allowing this, they're not using conformant ECMAscript parsers. http://www.ecma-international.org/publications/standards/Ecma-262.htm

it's a word doc, do a search in it for 'automatic semicolon insertion'. saying that though; I'd personally recommend a real semicolon after every statement. ( in javascript and english. )

perhaps you're getting confused about java / javascript yourself there MidiMagic :P ... but, the OP did insist on repeatadly 'saying' java even after correction... the original code is html + javascript + asp with vbscript, without a hint of java. and it's way too long for me to read more than half of it.

who had the java.* name first?

MattEvans
Veteran Poster
Moderator
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You