Limitation of Var variable

Discussion in 'Javascript' started by Pawan, Oct 8, 2007.

  1. Pawan

    Pawan Guest

    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
     
    Pawan, Oct 8, 2007
    #1
    1. Advertising

  2. Pawan

    Stevo Guest

    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 :)
     
    Stevo, Oct 8, 2007
    #2
    1. Advertising

  3. Pawan

    Pawan Guest

    On Oct 8, 12:50 pm, Stevo <> wrote:
    > 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
     
    Pawan, Oct 8, 2007
    #3
  4. On Oct 8, 8:33 am, Pawan <> wrote:
    > 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/
     
    David Dorward, Oct 8, 2007
    #4
  5. David Dorward wrote:
    > On Oct 8, 8:33 am, Pawan <> wrote:
    >> 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>
     
    Thomas 'PointedEars' Lahn, Oct 8, 2007
    #5
  6. On Oct 8, 2:08 pm, Thomas 'PointedEars' Lahn <>
    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/
     
    David Dorward, Oct 8, 2007
    #6
  7. Pawan

    Evertjan. Guest

    Thomas 'PointedEars' Lahn wrote on 08 okt 2007 in comp.lang.javascript:

    > David Dorward wrote:
    >> On Oct 8, 8:33 am, Pawan <> wrote:
    >>> 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)
     
    Evertjan., Oct 8, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alvin Bruney

    Threads.. Session var lost, App var ok

    Alvin Bruney, Dec 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    365
    rooster575
    Dec 2, 2003
  2. thomson
    Replies:
    10
    Views:
    2,498
    Eliyahu Goldin
    Jun 20, 2005
  3. thomson
    Replies:
    0
    Views:
    386
    thomson
    Jun 20, 2005
  4. Fred
    Replies:
    3
    Views:
    327
    Alf P. Steinbach
    Aug 10, 2003
  5. Keiron Waites

    var.innerHTML where var is a variable!!

    Keiron Waites, Aug 11, 2003, in forum: Javascript
    Replies:
    2
    Views:
    83
    Martin Honnen
    Aug 11, 2003
Loading...

Share This Page