Results 1 to 3 of 3

Thread: jscript -> asp

  1. #1

    Thread Starter
    Hyperactive Member richy's Avatar
    Join Date
    Jan 1999
    Location
    Liverpool, England
    Posts
    353
    I have a value in my JavaScript but I need my ASP code on the same page to be able to look at this value, but I can't get it to.
    For example, I have the following JavaScript code:

    <SCRIPT LANGUAGE=JAVASCRIPT>
    thisvalue="bob";
    alert(thisvalue);
    </SCRIPT>


    <%
    // i need to find out the value of thisvalue, but i can't
    %>

    Can anybody tell me of a way of getting this value, when it's on the same page.

  2. #2
    Hyperactive Member Kagey's Avatar
    Join Date
    Sep 2000
    Location
    The Wilderness of New Brunswick
    Posts
    294
    asp is executed on the server, and javascript is executed at the client. therefore, asp cant read javascript variables, but you can pass an asp variable to javascript like this:
    Code:
    <% 
    aspvalue = "bob"
    %> 
    
    <SCRIPT LANGUAGE=JAVASCRIPT> 
    thisvalue="<%=aspvalue%>"; 
    alert(thisvalue); 
    </SCRIPT>

  3. #3

    Thread Starter
    Hyperactive Member richy's Avatar
    Join Date
    Jan 1999
    Location
    Liverpool, England
    Posts
    353

    don't suppose...

    i don't suppose any one has any ideas as to work around this then as i've been through 3 different ideas...

    there's a menu in a side bar on a left frame which has a drop downlist on as well. the links on the left hand bar, when selected, then change the location in the right hand frame. this page then needs to be able to get the drop downlist option that the user has selected. is there anyway of doing this because i've tried setting the location of the right frame from the left frame, which doesn't refresh and the original version of getting the value from the left bar in the right bar by javascript, but the above problem arises.

Posting Permissions

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



Click Here to Expand Forum to Full Width