sharmi mekala

Greenhorn
+ Follow
since Sep 04, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sharmi mekala

Yes David. All these days I was under the impression like Java is similar to Javascripts but not any more
until we get a bug we never dig into concepts which shouldnt be the case
Thanks David

I think I got what you said
If one of the comparision operands is integer then it will convert the other into integer( is that what you meant) (2=="2" --> true)

Your code is working great. Thanks for helping me in refractoring the code
you are the best

Hi Bear

"Don't blame the language because you aren't writing it correctly. "

Dont take my words negatively. FYI I am not blaming the language but trying to understand the differences in languages.
System.out.println("x">"y");
when I say this in java it gives me an error saying that > operator is not allowed for type string,string
I was expecting the same in javascript which wasnt the case.
Hi Eric,

I understand that.

We need to write 4 statements to just convert a integer value from textfield to javascript variable of type int
I was just trying to figure out if we had a better way to do this

Anyways my question is answered - always we need to do an internal conversion to int in javascript when we take integer values from textfield

I was under an impression that while using arithmetic comparisions like > , < then javascript will try to convert variable values to integers and performs the operations( which was wrong )

Thank you all for clarifying my doubt

Finally learnt something today
That makes sense David
But why should i write these many statements just because javascript doesnt understand the difference between a string and a number

var minValue=parseInt(document.getElementById(minField).value,10);
var maxValue=parseInt(document.getElementById(maxField).value,10);

if(isNaN(minValue))minValue=0;
if(isNaN(maxValue))maxValue=0;

The problem is parseInt treates empty string as NaN but I want that to be treated as 0 so i needed to write above 2 lines of code extra. (An end user doesnt care if he puts 0 or blank string when its not a mandatory field)
I know a blank string is 0 in case of integers but not javascript

sometimes we need to program in using roundabouts just because of the inconsistencies in programming language
I love programming but not this kind
Thanks for the reply David
But this is happening with only when x is in "1,2,3,4,5,6,7,8,9" and y is geater than 10
After than all other comparisions are giving the correct results. Why is this happening only when x<10 and y>10
Hi All,

With the below code 2>11 results true which shouldnt be the case
one might ask me to initialise like x=2 and y=3 but when we take the values from text fields the values will be a string rather than an integer when we use document.getElementById()
Can someone please tell me why this is happening in Javascript. It was a crazy day for me to figure out why this was happening but i was clueless


<html>

<body>



<script type="text/javascript">



var x="2";

var y = "11";

alert(x>y)


</script>


</body>

</html>

Hi Authors,

if this is not a repeated question...just wanted to ask why you wanted to write a book on JBoss and what were the challenges you faced when you started it...how did you feel after finishing the book and seeing the first publication...very glad to see a book on JBoss....

15 years ago
when a servlet forwards a request(rd.forward("another servlet")) to "another servlet" and if a filter bypasses the request(request from first servlet to another servlet) and if the filter sets a new request attribute before calling chain.doFilter() why is the new request attribute not visible to "another servlet"
[ September 09, 2008: Message edited by: sharmi mekala ]