Tuesday, 27 August 2013

Url Blocking SMF Mod (mine) JQuery: .val() doesn't work fine

Url Blocking SMF Mod (mine) JQuery: .val() doesn't work fine

Well, I have this code:
//Url-Block
echo '<script type="text/javascript">
function logged_in() {
return $(\'#userStatus\').val() == \'User\' ? true : false;
}
$(document).ready(function() {
if(!logged_in()) {
$("#url-lock").html("<span style="color:red;font-weight:bold;">[Sólo
los usuarios pueden ver este contenido. <a href="' . $scripturl .
'?action=register">Regístrate</a> o <a href="' . $scripturl .
'?action=login">loguéate</a> para ver dicho
contenido.]</span>").removeAttr("href").wrap("<strong></strong>");
}
});
</script>';
That makes that the guests can't see any link that have [url-lock] bbc
tag... But idk why it doesn't work...
#url-lock works well...
#userStatus too...
So.. Jquery is bad coded, that can I do? I have never programmed in Jquery ;(
The error is here:
function logged_in() {
return $(\'#userStatus\').val() == \'User\' ? true : false;
}
Idk, how to do that it works... :/
Sorry, and thank you!

No comments:

Post a Comment