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 10 of 10
  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Remote acces to Javascript (online ??) PLEASE HELP :(

    Hi there people... i dont know if this is the right place to post this but hey... you mod's can always move this ^^

    Oke i got a question...

    Lets say i got a javascript file (nopcart.js)
    In this javascript file in the first 50 lines, there ar e a buch of variables.

    Is it possible (i DO think that it is) to change those variables from the website itself, on a kinmda damin page... so lets say i got a form on that page, and i put in numbers, and press submit... the variables in the script are changed...

    Tnx (i hope)

    Mr. DJ

  • #2
    Regular Coder Nischumacher's Avatar
    Join Date
    Oct 2005
    Location
    Bombay, India
    Posts
    196
    Thanks
    0
    Thanked 2 Times in 2 Posts
    i don't think it is possible.

    as long as the session is alive... the variables can be given new values... once the session is over... you are back to square one.
    Last edited by Nischumacher; 12-29-2005 at 04:55 PM.
    - NS 666
    .net DEVILoper

  • #3
    New Coder
    Join Date
    Dec 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Javascript cannot write/change a file on your server. That can only be done via a server side script such as PHP or ASP.

  • #4
    New Coder
    Join Date
    Dec 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by konithomimo
    Javascript cannot write/change a file on your server. That can only be done via a server side script such as PHP or ASP.
    so i did post this in the wrong section...

    Javascript doesent need to change another file...
    another file needs to change Javascript

  • #5
    New Coder
    Join Date
    Nov 2004
    Location
    wisconsin
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you mean to actually change the file or just change the variable values? becuase they are a lot different.
    Can you commentate bowling?

  • #6
    New Coder
    Join Date
    Dec 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jettlarue2003
    do you mean to actually change the file or just change the variable values? becuase they are a lot different.
    well i got this file: Nopcart.js

    and as example on line 75 there is this code
    Code:
    Brief0_20g 			= 0.39;		// prijs bij brief 0 (ag) to 20 (bg) g in euro
    what i would like is that i can with just filling in a form change the 0.39

    so... thats the var not the file

  • #7
    New Coder
    Join Date
    Dec 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Mr. DJ
    so i did post this in the wrong section...

    Javascript doesent need to change another file...
    another file needs to change Javascript
    Your javascript is saved in a .js FILE . . . thus you are trying to write/change a
    file on your server, which JS cannot do.

  • #8
    New Coder
    Join Date
    Dec 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by konithomimo
    Your javascript is saved in a .js FILE . . . thus you are trying to write/change a
    file on your server, which JS cannot do.
    and with other internet code langues? can i change with php the vaiables inside a js file?

    let make this clear....

    -i have variables inside an javascript FILE
    -i want to change them online using a formlike

    -----either: can i add javasxript code to the specific file, to have a button. If u click on that button, fill in the admin password, u get an form in wich i can change the vars ( iknow how to make the table, not how to make the button and password thingie)
    -----other way: using a different file with an code wich does the same


    -so i dont need a javascript file, wich changes a javascript file if thats what ya mean :P
    Last edited by Mr. DJ; 12-29-2005 at 09:32 PM.

  • #9
    New Coder
    Join Date
    Dec 2005
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, server side scripts such as PHP allow you to create/read/write to a file on your server.

  • #10
    New Coder
    Join Date
    Dec 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by konithomimo
    yes, server side scripts such as PHP allow you to create/read/write to a file on your server.

    http://www.codingforums.com/showthread.php?t=75818

    fot those who care, i made an phph tread ^^, tnx for your time


  •  

    Posting Permissions

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