Link to home
Start Free TrialLog in
Avatar of bjh497
bjh497

asked on

jquery check if url # parameter exists

very quick query.

trying to check if url # parmeter exists.
E.G. if url is www.test.com/this.php#success

If sucess exists do x els do nothing.

Is ther a quick efficient way of checking this in jquery
Avatar of leakim971
leakim971
Flag of Guadeloupe image

use :

if( location.hash != "" ) { 
   alert(" the url contain # " );
}
else {
   alert(" the url don't contain # " );
}

Open in new window


More info here : http://www.w3schools.com/jsref/prop_loc_hash.asp
Avatar of bjh497
bjh497

ASKER

can we specifically test for #success
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial