1

I opened a webpage (http://www.designova.net/rise/index-01.html) and viewed its source code. And then I saved the page to my computer and then opened it in an editor (sublime text 2). Now the HTML content in two files are different. I assume this is deliberately done but I am not sure why.

Among the two HTML versions, which is the reference HTML I can use in case I want to develop a similar webpage?

The difference is not only in URLs but also additional code snippets are added when downloaded.

Original body tag: <body>

After downloading: <body class=" pace-done"><div class="pace pace-inactive">

  • 1
    There isn't enough information here to make your question answerable. You haven't told us the editor you used, and you didn't describe the differences in the HTML. – Robert Harvey Aug 31 '14 at 05:51
  • The question is about the behavior of some (unspecified) browsers and about editors, not about programming (even in the broad sense that covers writing HTML). – Jukka K. Korpela Aug 31 '14 at 12:31
  • It could very well be that these changes (class additions) are done by JavaScript after the page loads. So the answer depends on whether you plan to use scripts to alter the page after load. – 0b10011 Sep 02 '14 at 16:01

1 Answers1

2

The browser will commonly rewrite URLs if you are saving a "complete" web page--meaning if referenced files (images, scripts, etc.) are also downloaded. When you "view source", this is the actual HTML returned by the server, so use that as a reference.

If you save your web page as "HTML Only" you should get the same HTML as "View Source."

Note that Javascript can change the DOM dramatically so the code you see in View Source can be totally different from what you see in the DOM. The original page source is only used to generate the initial page.

If you have dynamic content in your page, you will have to convert your current DOM to HTML using developer tools. This question gives a lot more detail about how this works.

Community
  • 1
  • 1
nullability
  • 10,545
  • 3
  • 45
  • 63
  • I think I am getting this now, thanks for redirecting me to this point. –  Aug 31 '14 at 05:59