Limitation of Var variable

P

Pawan

Hi,

Can anyone please suggest me on this.

I am using var variable to get a string.Its working fine if string is
of simple type.

But giving error after entering 'Enter' or 'special charcters' in the
string.

Is it a limitation to var variable?

Can anyone suggest me on this.

Thanks,
Pawan
 
S

Stevo

Pawan said:
Can anyone please suggest me on this.
I am using var variable to get a string.Its working fine if string is
of simple type.
But giving error after entering 'Enter' or 'special charcters' in the
string.
Is it a limitation to var variable?

You're not using a var to "get" the string, you're just storing it
(after you've got it) into a variable. The important thing here is how
you're getting the variable. You could be receiving it via a JSON or XML
file, you could be capturing the keys, reading it from a form input.
There are many ways you could be "get"ting the string, and it's these
methods that are important in determining your problem. Explain how
you're getting it, and post the relevant bit of code and you'll be more
easily helped :)
 
P

Pawan

You're not using a var to "get" the string, you're just storing it
(after you've got it) into a variable. The important thing here is how
you're getting the variable. You could be receiving it via a JSON or XML
file, you could be capturing the keys, reading it from a form input.
There are many ways you could be "get"ting the string, and it's these
methods that are important in determining your problem. Explain how
you're getting it, and post the relevant bit of code and you'll be more
easily helped :)


var is getting this value from a text box.
Thanks,
Pawan
 
D

David Dorward

I am using var variable to get a string.Its working fine if string
is of simple type.

What is a 'var variable'? One declared with the var keyword to limit
its scope?
But giving error after entering 'Enter' or 'special charcters' in
the string.

What error? What characters are special? What code are you using?
 
T

Thomas 'PointedEars' Lahn

David said:
What is a 'var variable'? One declared with the var keyword to limit
its scope?

Certainly, as there are no other variables.


PointedEars

P.S.
Your signature separator is still borken, probably because of Google Groups.
 
D

David Dorward

Your signature separator is still borken,
probably because of Google Groups.

Yes. I look forward to moving, getting my own Inet connection back up,
and having a proper NNTP server to use again.
 
E

Evertjan.

Thomas 'PointedEars' Lahn wrote on 08 okt 2007 in comp.lang.javascript:
Certainly, as there are no other variables.


In casu strictior there are:

Function arguments are not declared with the var statement.

DOM variables are not declared with the var statement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top