Here an example of my code, which when user click a link then it will load a specific content id and will show default content if there have no click action into #content div
$(document).ready(function () {
$.ajaxSetup({
cache: false
});
$("a.view").live('click', function (e) {
var id = $(this).data("id");
$('#content').load("content.php?" + id);
e.preventDefault();
});
$('#content').load("content.php");
});
Question, how to load a content automatically when user using direct link or type in url bar : example http://domain.com/content.php?id=5
So if user type or using direct link I want script doing exactly like .live('click') and load the current id example is 5
Let me know.