By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

Limitation of Var variable

P: n/a
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

Oct 8 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Pawan wrote:
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 :)
Oct 8 '07 #2

P: n/a
On Oct 8, 12:50 pm, Stevo <ple...@spam-me.comwrote:
Pawan wrote:
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 :)

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

Oct 8 '07 #3

P: n/a
On Oct 8, 8:33 am, Pawan <maxpa...@gmail.comwrote:
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?

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/

Oct 8 '07 #4

P: n/a
David Dorward wrote:
On Oct 8, 8:33 am, Pawan <maxpa...@gmail.comwrote:
>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?
Certainly, as there are no other variables.
PointedEars

P.S.
Your signature separator is still borken, probably because of Google Groups.
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Oct 8 '07 #5

P: n/a
On Oct 8, 2:08 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
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.

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/

Oct 8 '07 #6

P: n/a
Thomas 'PointedEars' Lahn wrote on 08 okt 2007 in comp.lang.javascript:
David Dorward wrote:
>On Oct 8, 8:33 am, Pawan <maxpa...@gmail.comwrote:
>>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?

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.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 8 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.