Results 1 to 11 of 11

Thread: javascript

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779

    Angry javascript

    I keep getting an "undefined" error when I try to pass a asp variable into javascript. What am I doing wrong?

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    post ur code..
    ksm

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779
    <%
    exportfile = ExportFileName
    %>

    <SCRIPT LANGUAGE=javascript>
    <!--
    window.open('http://www.mywebpage.com/' + <%=exportfile%>, 'DatabaseActivity', 'resizable,scrollbars,toolbar')
    -->
    </SCRIPT>

  4. #4
    Lively Member
    Join Date
    Jul 2001
    Location
    USA
    Posts
    95
    window.open('http://www.mywebpage.com/<%=exportfile%>', 'DatabaseActivity', 'resizable,scrollbars,toolbar')

    that should do it

  5. #5
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    <%
    exportfile = 10
    %>

    <SCRIPT LANGUAGE=javascript>
    <!--
    alert('http://www.mywebpage.com/' + <%= exportfile %>);
    window.open('http://www.mywebpage.com/' + <%=exportfile%>, 'DatabaseActivity',

    'resizable,scrollbars,toolbar')
    -->
    </SCRIPT>



    i hav checked with abv code and its wrking for me .. from where r u getting ur 'ExportFileName '
    ksm

  6. #6
    Lively Member
    Join Date
    Jul 2001
    Location
    USA
    Posts
    95
    Originally posted by Kunchesm
    <%
    exportfile = 10

    alert('http://www.mywebpage.com/' + <%= exportfile %>);
    That works b/c it like saying
    alert("hello" + 10);
    which is fine but

    window.open("http://www.mywebpage.com/"+10)
    would not b/c the 10 is outside of the quotes

  7. #7
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    India
    Posts
    342
    i hav given alert just for double cheking!! ..
    the webpage also opened with the required address .. but with HTTP 404 page cannot be found!
    ksm

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779
    Thanks. I got it to work. This is what I used:
    window.open('http://209.113.245.58/Upload/Temp/<%=exportfile%>', 'DatabaseActivity', 'resizable,scrollbars,toolbar,location')

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779
    Is there any way to tell when a popup window gets closed?

  10. #10
    Lively Member
    Join Date
    Jul 2001
    Location
    USA
    Posts
    95
    window.onUnload = alert("close"); will tell you when a window closes.

    Kunchesm, I am sorry you are right, I did not know. But why did my solution correct the problem then if there was no problem?

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779
    Where do I put that code? I am opening a pdf file in a new window and I want to know when the user closes that window so I can execute some more code.

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