SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Evangelist kuhajeya's Avatar
    Join Date
    Sep 2003
    Posts
    486
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question access the variables

    is it possible to access the servariable inside the client script?
    if so can some one give me an example?

    thanks kuha.......

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure what you mean by "the client script"....

  3. #3
    SitePoint Evangelist kuhajeya's Avatar
    Join Date
    Sep 2003
    Posts
    486
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi harvey

    here, say is this is a legal code?


    <BODY>
    <%
    dim myVar
    myVar = "test"
    %>

    <SCRIPT LANGUAGE=vbscript>
    <!--
    document.write("here "&<%=myVar%>)
    //-->
    </SCRIPT>
    </BODY>

    if not so how then??

  4. #4
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohhh, I see. Yes. I have code examples of passing variable in VB in to client-side JavaScript functions, etc.

    Should be fine.

  5. #5
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kuhajeya
    hi harvey

    here, say is this is a legal code?


    <BODY>
    <%
    dim myVar
    myVar = "test"
    %>

    <SCRIPT LANGUAGE=vbscript>
    <!--
    document.write("here "&<%=myVar%>)
    //-->
    </SCRIPT>
    </BODY>

    if not so how then??
    Yes, it's "legal". Just make sure you understand where & when server-side and client-side code execute. Confusion is common among beginners.
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  6. #6
    SitePoint Evangelist kuhajeya's Avatar
    Join Date
    Sep 2003
    Posts
    486
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    is it ok???

    Quote Originally Posted by M@rco
    Yes, it's "legal". Just make sure you understand where & when server-side and client-side code execute. Confusion is common among beginners.
    >>>>>>>>>
    but this is not working for me ..???
    could u just eloborate more on this???

    thanks
    kuha...

  7. #7
    SitePoint Evangelist kuhajeya's Avatar
    Join Date
    Sep 2003
    Posts
    486
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    so please some!!

    Quote Originally Posted by greg.harvey
    Ohhh, I see. Yes. I have code examples of passing variable in VB in to client-side JavaScript functions, etc.

    Should be fine.
    ok that is fine
    i wish if i could see some of that ! so if u can please forward to me.

    thanks
    kuha...

  8. #8
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I meant it was "legal" in terms of it being possible to do what you are trying to do, but your code is invalid.

    This:
    Code:
    document.write("here "&<%=myVar%> )
    should be this instead
    Code:
    document.write("here <%=myVar%>")
    Do you understand why?
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  9. #9
    SitePoint Evangelist kuhajeya's Avatar
    Join Date
    Sep 2003
    Posts
    486
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok got it
    thanks Tucker

    kuha..........


Bookmarks

Posting Permissions

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