html - Link doesn't work when href attribute value is url encoded -


why link doesn't work when href attribute value url encoded?

are not supposed encode it? same behavior observed in chrome & ff

works

<!doctype html> <html> <body>  <p>sweet fruit: <a href="http://google.com/search?q=banana">banana</a></p>  </body> </html> 

doesn't work

<!doctype html> <html> <body>  <p>sweet fruit<a href="http%3a%2f%2fgoogle.com%2fsearch%3fq%3dbanana">banana</a></p>  </body> </html> 

its protected link. how encode works http://www.w3schools.com/tags/ref_urlencode.asp

this link u showed first 1 decoded , second 1 encoded .

http://google.com/search?q=banana http%3a%2f%2fgoogle.com%2fsearch%3fq%3dbanana

lets take look

in case "/" becomes %2f, "?" %3f , "=" %3d

its protection , link can not used. dns cant read it. , see first link clickable , second 1 not.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -