Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: new variable

  1. #1
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,097
    Thanks
    15
    Thanked 1 Time in 1 Post

    new variable

    How do i add a value of '5' to an ASP value i have to create a new variable in javascript?

    I have a variable called bookings, but i want a new javascript variable called top to be the value of bookings + 5.

    Something like this below?

    top="<%=bookings%>+1"


    and do i write it out as '+top+'

    thanks.

    picco

  • #2
    New to the CF scene
    Join Date
    Feb 2005
    Location
    Monterrey, Mexico
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First of all, i am not sure i am understanding the problem quite right, but what I understood from your post is that you want a line of javascript that will be changing dinamically every time the server returns the document.

    If that is the case, then your line of code should be:
    top = <%=bookings%>+1
    // this line should be part of an external .js file or as inline javascript
    // and will be evaluated on the client, but this line will get built on the server

    That way, assuming that bookings may be different every time the server puts together the returning html document, you will get lines such as:
    top = 5 + 1
    top = 6 + 1
    ... and so on...

    Hope this helps,
    Javier


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •