How do they do it? Dynamically loading pages / websites ... Framework, script? PHP, jQuery, Ruby?

So, I'm sure that a bunch of you saw or even use sites that load pages, it would seem, dynamically, without even changing pages. As well as changing the URL in the address bar.

Some great examples are reverbnation.com and rdio.com, I'm sure there is something else that has just begun.

So my question is ... How do they do it? What coding language do they use? it is a combination of languages. Do you know any tutorials that might be helpful.

I think it could be a combination of ajax, jquery and php. Is it possible to use iFrames? But I was just curious if there is a framework or jquery plugin that I am missing.

Thanks for any help.

+3
source share
4 answers

I will quickly scan their code to find out that http://www.reverbnation.com/ uses a lot of javascript to make this work.

Basically you need: - A database backend, which may be MySQL. - A markup language for the presentation of, say, HTML - a programming language such as PHP to execute logic

What you ask is AJAX, which means asynchronous JavaScript. Here you have good sources for learning the basics of AJAX: http://www.w3schools.com/Ajax/ajax_intro.asp

+1
source

The general category of such solutions is called "ajax".

, - , - " -". , , - - ( html) javascript - ( ).

-, javascript -. , javascript - , -.

, , .

0
0

, , .

, - . , .

;

 var href = window.location.href;

href .

href = href.split("#/");

#  

item = href[1].split("/");

, .

lastitem = item[item.length-1]

var. , , , .

, , - href -, , "", .

, , jquery ajax url. , , . php . jquery html ajax-url.

, , (/). php , .

$.ajax({
  url: lastitem'.php',
  success: function(data) {
    $('.content').html(data);
  }
});

Then the links will use jquery.click (). If there is a site called "about", the href link for that link may be <a href="#/about">About us</a>. This should then be added to the end of the URL in the address bar.

The click event may be like

$("a").click(function() {

   var href = $(this).attr(href);
   href = href.split(#/);
   href = href[href.length-1];

  $.ajax({
    url: href'.php',
    success: function(data) {
      $('.content').html(data);
    }

  });


});

This is just a simple idea that I am going to try.

0
source

All Articles