problems with VAR

Discussion in 'Javascript' started by overdalsveien@gmail.com, Jul 13, 2006.

  1. Guest

    hi

    This is probably elementary, but since my 'Dear Watson' is not present
    I hope you folks can help me::

    ---------------------------
    var dag = date1.getDate();
    document.getElementById("selDay1").innerHTML =
    makeRequest('test.php?d=1');
    -----------------------------------------------

    I try to put the value of date1.getDate() as a parameter in the call to
    test.php via a makeRequest.

    Everything works just fine as long as I use a fixed value for "d" (as
    in this example....).
    Obviously this is useless, so I want to use the variable "dag".

    I've tried som creative variations, but with very poor result.


    Help Please.......


    \fred Moerman


    ps.
    > "date1.getDate" comes from a calender
    > "makeRequest('test.php?d=XX')" makes a XMLHttpRequest to retrieve data from the server.
    , Jul 13, 2006
    #1
    1. Advertising

  2. Guest

    /*pre apologies if I dont understand your inquiry however it appears
    your question is a php question and maybe not a javascript inquiry
    ...?*/
    //php code
    /*in lieu of your "date1.getDate" that you said comes from a calender i
    got todays date*/
    $now = date("j");
    // then set your dag variable to equal todays day
    $dag = $now;
    //built up a string and concatenated it onto var with the . notation
    $newstr='test.php?d='.$dag ;
    // printed result just to show the
    echo $newstr;
    // here is the var in your code
    document.getElementById("selDay1").innerHTML=makeRequest('test.php?d='.$dag);

    //

    wrote:
    > hi
    >
    > This is probably elementary, but since my 'Dear Watson' is not present
    > I hope you folks can help me::
    >
    > ---------------------------
    > var dag = date1.getDate();
    > document.getElementById("selDay1").innerHTML =
    > makeRequest('test.php?d=1');
    > -----------------------------------------------
    >
    > I try to put the value of date1.getDate() as a parameter in the call to
    > test.php via a makeRequest.
    >
    > Everything works just fine as long as I use a fixed value for "d" (as
    > in this example....).
    > Obviously this is useless, so I want to use the variable "dag".
    >
    > I've tried som creative variations, but with very poor result.
    >
    >
    > Help Please.......
    >
    >
    > \fred Moerman
    >
    >
    > ps.
    > > "date1.getDate" comes from a calender
    > > "makeRequest('test.php?d=XX')" makes a XMLHttpRequest to retrieve data from the server.
    , Jul 13, 2006
    #2
    1. Advertising

  3. Guest

    wrote:
    > /*pre apologies if I dont understand your inquiry however it appears
    > your question is a php question and maybe not a javascript inquiry
    > ..?*/


    [snipp-snapp]

    I suppose I didn't fromulate the problem correctly.
    sorry

    Fortunately I figured out how to make i work::

    http://news.overdalsveien.com/

    click on a date and 4 interesting (??) flicks-pics are found.


    \fred
    , Jul 13, 2006
    #3
  4. Guest

    i like the pics yes and the calendar app altho i dont understand
    dytch(??)lol amazing resolution you have on other photos in your site
    i.e. nicco's confirmation ..anywho take care, mark ( from texas)
    wrote:
    > wrote:
    > > /*pre apologies if I dont understand your inquiry however it appears
    > > your question is a php question and maybe not a javascript inquiry
    > > ..?*/

    >
    > [snipp-snapp]
    >
    > I suppose I didn't fromulate the problem correctly.
    > sorry
    >
    > Fortunately I figured out how to make i work::
    >
    > http://news.overdalsveien.com/
    >
    > click on a date and 4 interesting (??) flicks-pics are found.
    >
    >
    > \fred
    , Jul 20, 2006
    #4
    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:
    350
    rooster575
    Dec 2, 2003
  2. thomson
    Replies:
    10
    Views:
    2,477
    Eliyahu Goldin
    Jun 20, 2005
  3. thomson
    Replies:
    0
    Views:
    363
    thomson
    Jun 20, 2005
  4. Fred
    Replies:
    3
    Views:
    315
    Alf P. Steinbach
    Aug 10, 2003
  5. Alex Vinokur
    Replies:
    4
    Views:
    464
    Ron Natalie
    Sep 24, 2003
Loading...

Share This Page