Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-28-2004, 02:40 PM   PM User | #1
dupps1
New Coder

 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
dupps1 is an unknown quantity at this point
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....
dupps1 is offline   Reply With Quote
Old 06-28-2004, 02:45 PM   PM User | #2
homerUK
Regular Coder

 
Join Date: Nov 2002
Location: Manchester, UK
Posts: 533
Thanks: 4
Thanked 1 Time in 1 Post
homerUK is an unknown quantity at this point
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?
homerUK is offline   Reply With Quote
Old 06-28-2004, 02:49 PM   PM User | #3
jbot
Senior Coder

 
Join Date: Feb 2004
Location: Edinburgh
Posts: 1,352
Thanks: 0
Thanked 0 Times in 0 Posts
jbot is an unknown quantity at this point
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?
jbot is offline   Reply With Quote
Old 06-28-2004, 02:50 PM   PM User | #4
dupps1
New Coder

 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
dupps1 is an unknown quantity at this point
yes...I just pasted the part which shows the onclick event....

Thanks
dupps1 is offline   Reply With Quote
Old 06-28-2004, 02:51 PM   PM User | #5
dupps1
New Coder

 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
dupps1 is an unknown quantity at this point
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...
dupps1 is offline   Reply With Quote
Old 06-28-2004, 03:03 PM   PM User | #6
dupps1
New Coder

 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
dupps1 is an unknown quantity at this point
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
dupps1 is offline   Reply With Quote
Old 06-28-2004, 03:18 PM   PM User | #7
jbot
Senior Coder

 
Join Date: Feb 2004
Location: Edinburgh
Posts: 1,352
Thanks: 0
Thanked 0 Times in 0 Posts
jbot is an unknown quantity at this point
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!!

jbot is offline   Reply With Quote
Old 06-28-2004, 03:35 PM   PM User | #8
dupps1
New Coder

 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
dupps1 is an unknown quantity at this point
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
dupps1 is offline   Reply With Quote
Old 06-28-2004, 03:41 PM   PM User | #9
jbot
Senior Coder

 
Join Date: Feb 2004
Location: Edinburgh
Posts: 1,352
Thanks: 0
Thanked 0 Times in 0 Posts
jbot is an unknown quantity at this point
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?
jbot is offline   Reply With Quote
Old 06-28-2004, 03:43 PM   PM User | #10
dupps1
New Coder

 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
dupps1 is an unknown quantity at this point
Yes...its an ASP page...and when i clicked the error message...i got the line number and Expected End statement message..

Thanks
dupps1 is offline   Reply With Quote
Old 06-28-2004, 03:55 PM   PM User | #11
jbot
Senior Coder

 
Join Date: Feb 2004
Location: Edinburgh
Posts: 1,352
Thanks: 0
Thanked 0 Times in 0 Posts
jbot is an unknown quantity at this point
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?
jbot is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:39 AM.


Advertisement
Log in to turn off these ads.