Results 1 to 2 of 2

Thread: Javascript again - hopefully explained a bit better!!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Angry

    Hello,

    I think my previous thread concerning this was a bit much to understand!! I'll try again.

    How can I pass a variable to this function..

    <script language="JavaScript">
    <!--
    function windowOpen1()
    { window.open("CityInterest.html","NewWindow","width=600,height=400,noresize,scrollbars=yes,toolbar=0, menubar=0");
    }
    // end popup windows -->
    </script>



    This is how I currently call this function......

    target = "_blank"
    link = "Javascript:windowOpen1()"

    <a href="<%=link%>" target="<%=target%>">


    What will happen now is that cityinterest.html will open in a new window with the specified
    width, height etc etc.

    My question now is....
    How can I change my variable "link", and my script to open up ANY page I specify within "link"??
    Eg. I am now bound to opening up cityinterest.html. Lets say I want to open testpage.htm - I
    would want to do something like

    target = "_blank"
    link = "Javascript:windowOpen1(),'testpage.htm'"
    <a href="<%=link%>" target="<%=target%>">

    I tried this an it does not work. In any case "cityinterest.html" is still hardcoded in my script!!

    EG. I want to be able to change my variable "link" as I wish and so be able to open any page
    via the script.

    Thanks,
    T

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    what your asking is not hard!!

    your asp produce(dynamically) html,right and javascript too!

    so when your page is beiing generated assign the value
    you want to your link!

    you can put it in a loop or for....next

    For x = 0 to 10
    %>
    <a href="<%="link" & x %>" target="<%="target" & x%>">
    <%
    next


    something like that anyway!!!






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