Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Jun 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Pop up function

    Hi guys...

    I am trying to create a pop up function and presently i have this below code but it does not seem to work and i get the "Error on page" error displayed whenever i click the link...

    Here is my code...

    **********************

    ""<a href='#' onclick='mypopupfunction("&rsitem("Itemnum")&");' title=""""" & (comments) & """""> " & RSitem("Itemname") & "</a>"")

    <script language="javascript">
    function mypopupfunction(itemidArg)
    {
    winvar = window.open('popupcomments.asp?itemnum='+itemidArg,'comments','menubar=no,scrollbars=no,resizable=ye s,width=200,height=200');
    }
    </script>

    **********************

    Thanks in advance....

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post
    looking at the code it's something to do with the line

    ""<a href='#' onclick='mypopupfunction("&rsitem("Itemnum")&");' title=""""" & (comments) & """""> " & RSitem("Itemname") & "</a>"")

    why are there speech marks around it? I assume its possibly being outputted by some other code?

  • #3
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question what's with the quotes?

    Quote Originally Posted by dupps1

    ""<a href='#' onclick='mypopupfunction("&rsitem("Itemnum")&");' title=""""" & (comments) & """""> " & RSitem("Itemname") & "</a>"")
    wot the heck is this?

    you've got waaaaay to many quotation chars in there, making it impossible to disassemble. and they're also the most likely cause.

    does the error msg say "unterminated end of string...", per chance?

  • #4
    New Coder
    Join Date
    Jun 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes...I just pasted the part which shows the onclick event....

    Thanks

  • #5
    New Coder
    Join Date
    Jun 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm...sorry guys for the confusion...here is the complete line of code and extra quotation marks are just the part of the other code

    Execute(dayname(rsitem("Menudate")) & " = AddToArray(" & dayname(rsitem("Menudate")) & ",""<a href='#' onclick='mypopupfunction("&rsitem("Itemnum")&");' title=""""" & (comments) & """""> " & RSitem("Itemname") & "</a>"")")


    Thanks...

  • #6
    New Coder
    Join Date
    Jun 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i am not getting any error messages like "Unterminated String... "...

    but at the bottom of the page i am getting this message "Done, but with errors on page"

    thanks

  • #7
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by dupps1
    i am not getting any error messages like "Unterminated String... "...

    but at the bottom of the page i am getting this message "Done, but with errors on page"
    if you double click that message, you'll get the real error!!


  • #8
    New Coder
    Join Date
    Jun 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok...i double clicked the error and got the message "Expected End of Statement" and it is referring to some line below the above excute statement where i wrote comments...

    Thanks

  • #9
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by dupps1
    it is referring to some line below the above excute statement where i wrote comments...
    how do you know this?

    is this page being parsed by ASP, per chance?

  • #10
    New Coder
    Join Date
    Jun 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes...its an ASP page...and when i clicked the error message...i got the line number and Expected End statement message..

    Thanks

  • #11
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the problem is in the ASP, not the JS as such.

    I take it the ASP is written in VBS? must be, since you're using the ampersands instead of plus signs for string concatenation.

    basically, these are being parsed out by the ASP, as is the function to be called.

    another point to note is that single quotations are comment delimiters. that is to say, anything which proceeds them is commented out. this is also part of the problem.

    you need to recode the ASP part first, since this is what's wrong.

    btw: is this for a commercial project or an educational one?


  •  

    Posting Permissions

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