Created
June 2, 2017 09:50
-
-
Save ledangtuanbk/5e77cbcfd97c854854a310b256932359 to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result = []; | |
function load(url, level) | |
{ | |
console.log("level: "+level+","+url); | |
$.get(url, function(data, status){ | |
var x; | |
if($(data).length>2) | |
{ | |
x=$($(data)[2]); | |
} | |
else | |
{ | |
x = $($(data)[1]); | |
} | |
var a1 = x.find("a"); | |
if(url.indexOf("DrugsID=")!=-1) | |
{ | |
debugger; | |
result.push(data); | |
} | |
else | |
{ | |
a1.each(function( index ) { | |
load("http://thuoc.net.vn/Ajax/"+$(this).attr("href")+"&AjaxRequestUniqueId=14956777706050", level+1); | |
}); | |
} | |
}); | |
} | |
load("http://thuoc.net.vn/Ajax/Default.aspx?Mod=ClassifyDrugs&AjaxRequestUniqueId=14956777706050", 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment