Dovberman
asked on
Java dynamic html href
I am trying to decipher someone elses undocumented code.
I do know that the following statement is designed to render a hyperlink on a line.
String myURL= “HTTP://MySite.com”;
out.println("<li class=\"\"><a href=\""+myURL+"/Help/Cont act/front. cfm?fromJS P=1\" title=\"PMS385\">PMS385</a ></li>");
What is the HTML that this statement renders?
Thanks,
I do know that the following statement is designed to render a hyperlink on a line.
String myURL= “HTTP://MySite.com”;
out.println("<li class=\"\"><a href=\""+myURL+"/Help/Cont
What is the HTML that this statement renders?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you,
>>Now it is clear. The \" represents the " character.
It is 'escaping' the next character.
Java interprets the " as a string delimiter. To have one inside a string you 'escape' it.
http://docs.oracle.com/javase/tutorial/java/data/characters.html
It is 'escaping' the next character.
Java interprets the " as a string delimiter. To have one inside a string you 'escape' it.
http://docs.oracle.com/javase/tutorial/java/data/characters.html
Escape Sequences
A character preceded by a backslash (\) is an escape sequence and has special meaning to the compiler. The following table shows the Java escape sequences:
ASKER
thanks,