I have a link in my application, which when clicked on it leads to another page. I want to execute jQuery on this new page after loading, but only if this particular link is clicked to go to the page.
I have this jQuery:
$('#new_to_topics').click(function(){
$(document).ready(function() {
$('#topic_guidelines').slideDown('normal');
$('#topic_guidelines').addClass('on');
});
});
where #new_to_topicsis the identifier of the link that leads to the new page, and
$('#topic_guidelines').slideDown('normal');
$('#topic_guidelines').addClass('on');
is the jQuery code that I want to execute on this new page. However, this does not work. How should I do it?
source
share