
Untitled
By: a guest on
Jul 6th, 2012 | syntax:
None | size: 0.55 KB | hits: 6 | expires: Never
Can jQuery detect a specific URL and perform a function based off that URL?
<html>
<head>
<title>Title</title>
<style type="text/css">
.content {
display: none;
}
.show {
display: block;
}
</style>
</head>
<body>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</div><!-- end .content -->
</body>
</html>
var url = "http://www.example.com/EIFS-items/search.php?l2=3,15,25";
$(function(){
if (location.href==url){
$('.content').show();
}
});
if(location.search == "?l2=3,15,25")
$('.content').addClass('show');