How can I get the dynamic content that was injected to a web page using ajax?
How can I check in code (no matter which language, just the principals) if an ajax call was actually made on a web page?
Thanks
How can I get the dynamic content that was injected to a web page using ajax?
How can I check in code (no matter which language, just the principals) if an ajax call was actually made on a web page?
Thanks
To do this, the anchors are usually used.
Sample URL
www.somegameaddress.com/#/name=Dallas
example function using jquery:
$(function () {
$(window).bind('hashchange', function (e) {
var anchor = document.location.hash;
console.log(anchor);
$.ajax({
url : anchor,
success : function(data){
$('body').html(data); // print data received in to body
}
});
});
});
I hope to be of help to you!
The answer is hidden in your question.
Dynamic
means Ajax
. To check the url which is called, you can browse either the Network Tab from the console (so you see all requests), this is faster.
Optionally, you can browse the scripts hoping to find where that ajax call is made, if it's called from client side.
This is a very basic post ajax call from jquery.
$("button").click(function(){
$.post("url.php", function(data, status){
alert("Data: " + data + "\nStatus: " + status);
});
});