View Full Version : about HTML sourcecode ? Help

07-08-2011, 02:15 PM
Hello , lets say i have this web site with search result


when i'm open source code page , i can't find the HTML Table that contain the information

Burglary @ 37XX BLAKE STREET 07/02/11 07:00 PM
Arrest @ 1XX W 14TH AVENUE 07/02/11 05:50 PM
Other @ 2XX E SPEER BLVD 07/02/11 05:08 PM
Theft @ 31XX N RALEIGH STREET 07/02/11 05:00 PM
Other @ 34XX W 32ND AVENUE 07/02/11 05:00 PM
Other @ 20TH STREET / N BROADWAY STREET 07/02/11 04:49

, Note : when i'm using web site extractor program like outwit , its show me this html table and exist ,

how come , where this table hide inside the source code:(

07-08-2011, 03:50 PM
If you look at the source code you’ll find a <div id='table_container'></div>. This is where the table is inserted dynamically with JavaScript. The term to search for is “AJAX”.

07-09-2011, 03:07 PM
so is it possible to locate this table information , or not ?

07-09-2011, 10:03 PM
Yes, probably if you use a JS debug console like in Firebug or similar browser dev tools in Safari, Chrome, or Opera to search the function that is including this stuff. Or you can manually search the JS files for the respective AJAX function.

Ah look, I think I’ve found the relevant file: http://s3.mylocalcrime.com.s3.amazonaws.com/javascripts/spotcrime_info.js
It looks like the script is retreiving the data directly from the database via JSON with the help of PHP of course:

function loadCrimes(center, radius, options) {
if (typeof(radius) === 'undefined' || radius === null) { radius = 0.010; }
$.each(crime_markers, function(index, value) {
crime_markers = [];

var url = "http://api.spotcrime.com/crimes.json?";
url += "lat="+center.lat();
url += "&lon="+center.lng();
url += "&radius="+radius;
url += "&callback=?";
url += "&key=MLC";

The code in the lines following these is compiling the table HTML with the data.