Click to See Complete Forum and Search --> : Can someone explain what this line of code does?


Wallykid
09-02-2003, 01:35 PM
Response.Write "<td><a href=javascript:CompanyInfo("&chr(34)&rscomquery("id_num")&chr(34)&");>Learn more</a></td>"

I know it basically uses javascript to call CompanyInfo() function, and however, the function i see has only 1 parameter, and in there they have ("&chr(34)&rscomquery("id_num")&chr(34)&") all this. I don't know what each piece does...

e.g. &chr(34) - i know chr() gives us the character that is being represented by the character code in parenteses.
So my question is why does the & sign does, and what is the whole thing mean?

txmail
09-06-2003, 11:53 PM
I am being a bit lazy so I did not look up character code 34, but the & simply joins the character code and the string, my guess is that they might be inserting double quotes into the string as not to terminate the string pre-maturely. Or atleast that is what we do in ASP when we have to have a string with a quote or double quote in it.

Wallykid
09-07-2003, 02:57 AM
Thanks for the reply, i think you are right.