Why I can't see Ajax loaded content in code?

I've been wondering for quite some time, why when i get ajax response from php and load it with innerHTML into a div, I can visually see content but under source code its nothing?

As an example, this website http://www.hempatia.si/kategorija-pripomocki uses ajax for loading content and I can still see the products in source page.

Thanks for all answers in advance!

Upvotes: 0

Views: 709

Answers (3)

twitch
twitch

Reputation: 225

Right click on your mouse and select inspect element you will see the changes after ajax response

Upvotes: 0

nnnnnn
nnnnnn

Reputation: 150070

When you use your browser's "View Page Source" (or equivalent) option it shows the original source from when the page first loaded.

To see the "source" reflecting the current state of the page use your browser's dev/debug tools (F12 in Chrome or IE; ctrl-shift-i in FF).

Note that the browser isn't really maintaining the "source" per se, when the page first loads the browser parses the original source to create a DOM for the page and dynamic changes are made to the DOM.

Upvotes: 2

sai sudhakar
sai sudhakar

Reputation: 204

Dynamic content will not come in veiw source. Install firebug for Firefox. You can able to view that content.

Upvotes: 0

Related Questions