Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question about HTML sourcecode ? Help

    Hello , lets say i have this web site with search result

    http://www.spotcrime.com/#80001

    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

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,793
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    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”.

  • #3
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so is it possible to locate this table information , or not ?

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,793
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    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.

    Edit:
    Ah look, I think I’ve found the relevant file: http://s3.mylocalcrime.com.s3.amazon...tcrime_info.js
    It looks like the script is retreiving the data directly from the database via JSON with the help of PHP of course:
    Code:
    function loadCrimes(center, radius, options) {
      if (typeof(radius) === 'undefined' || radius === null) { radius = 0.010; }
      $.each(crime_markers, function(index, value) {
        value.setMap(null);
      });
      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.
    Last edited by VIPStephan; 07-09-2011 at 10:14 PM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •