Jquery Text Variable
Posted
by Batfan
on Stack Overflow
See other posts from Stack Overflow
or by Batfan
Published on 2010-04-12T20:43:34Z
Indexed on
2010/04/12
20:53 UTC
Read the original article
Hit count: 344
I am trying to get jquery to pick up variable that I am defining and I'm having issues doing it.
$.ajax({
url: "sitemap.php",
cache: false,
success: function(html){
$("#results").append(html);
var $seriestitle = $("#define-title").text();
$('#results a:contains("$seriestitle")').addClass('current-series');
$('a:not(".current-series")').hide();
}
});
This is the code I am using. You can view the page at the following URL:
http://benjammindesigns.com/XML/details/1231.html
There is a span on the page, with the ID 'define-title', that contains text. I am trying to pull the text from that span and use it as my variable.
Any info is greatly appreciated.
© Stack Overflow or respective owner