SyntaxFix
Write A Post
Hire A Developer
Questions
The first thing that comes to my mind is a one-liner regex:
var pageNum = $("#specificLink").attr("href").match(/page=([0-9]+)/)[1];