You are here:

HTML/doubt :compare 2 url in html

Advertisement


Question
QUESTION: I want to compare 2 url in my html page using if else. but i dont know how to do it.
1st url current url
2nd url some http://www.---.com/---
kindly help me

ANSWER: What do you mean by comparing them?

---------- FOLLOW-UP ----------

QUESTION: Checking the name of the 2 website address are same(only name).
for example
https://mail.google.com/mail/
and
https://mail.google.com/mail/

are same

https://mail.google.com/mail/
and
https://www.gmail.com

are different

Answer
Right.  So when you say you want to compare them, what do you actually want to do, or to show the user?

To do this you'd need to use PHP, JavaScript, or another client side or server side language, which is a very different technology than just HTML.

HTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Dan Stephenson

Expertise

I am a professional Web Designer & Developer. I work with HTML, XHTML and CSS every day, and would be glad to help with your problems, and answer your questions.

Experience


Experience in the area I have been a web designer/developer since 1997. I started developing websites with HTML 3.2 and using tables for layout. In 2006 I received my degree in Computational Media, and now work full time as a Webmaster and Interactive Media Author, as well as teaching continuing education courses on HTML, CSS and ActionScripting at my local college. Currently I design with XHTML and CSS - no tables and much cleaner and more accessible code and allows the designer more freedom and flexibility than tables.

Education/Credentials
New Media Production & Design Degree - SAIT Polytechnic

©2016 About.com. All rights reserved.