PHP structure changed into a jQuery
As this structure changed into a jQuery? And if this is possible at all?
$path=$_SERVER["REQUEST_URI"];
$pathkor = substr(strrchr($path, "/"), 1);
$var = "/актеры/женщины/";
if(strstr($pathkor开发者_JAVA技巧, '%D0%B6%D0%B5%D0%BD%D1%89%D0%B8%D0%BD%D1%8B') or strstr($pathkor, '98+99+100+101')){
print '<div class="punkt active"><a alt="А-Б-В-Г" title="А-Б-В-Г" href="'.$var.'98+99+100+101">А-Г </a> </div>';
} else {
print '<div class="punkt "><a alt="А-Б-В-Г" title="А-Б-В-Г" href="'.$var.'98+99+100+101">А-Г </a> </div>';
}
The meaning of this code. Find the latest entries in an alias, and compare them. And if there is a match then appoint a special class.
You will need to be more specific on how you want to identify the divs to add the classes to.
I imagine it would look something similar to:
var path = window.location.pathname;
var pathkor = path.split('/');
pathkor = pathkor[pathkor.length - 1];
var hrefvar = "/актеры/женщины/";
if(pathkor.match('%D0%B6%D0%B5%D0%BD%D1%89%D0%B8%D0%BD%D1%8B') != null || pathkor.match('98+99+100+101'))
{
//$(FOO_SELECTOR).attr('href', hrefvar + '98+99+100+101');
//$(FOO_SELECTOR).addClass('active');
}
else
{
//$(FOO_SELECTOR).attr('href', hrefvar + '98+99+100+101');
}
精彩评论