Link to home
Start Free TrialLog in
Avatar of geeta_m9
geeta_m9

asked on

Is the content on a HTML page all literal values?

I have a question about HTML files. Some HTML pages have only static content in them. Others are created using dynamic content, e.g., content that is pulled from a database.

My question is whether all the final content in the HTML files are literal values, whether they were originally static or pulled from a database, or  do they also contain variables, etc? For example, if I were to copy all the code from a HTML file and paste it in a new blank file, would I see exactly the same HTML content in the browser? What about the styling aspect of it? If the HTML page used stylesheets, how would that affect the new page?

Thank you.
Avatar of Spaz_IT
Spaz_IT

No they are not all literal values, these days they are mostly interpreted and processed from server side.
ASP and PHP are all server side languages and widely used, there are also others but the main purpose of these is that the client is not exposed or intercepts sensitive data.
The combinations vary, however all SQL data and variables are stored on the server.

Copying and pasting the HTML code will not get you the whole story unless it is a basic/static  web page.
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geeta_m9

ASKER

Thanks, what about the content itself? If the values in the browser are being output from variables, will it be the actual, literal values that appear in the browser?
It will the values that you copied when you copied the code.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your detailed explanation, Julian. So in other words, the content should stay the same if the code was copied and pasted to a new page. However, the behavior and look and feel (formatting) would be affected if it uses AJAX, external JavaScript and stylesheets and images?
So in other words, the content should stay the same if the code was copied and pasted to a new page.
If by cut and paste you mean from the source obtained by doing a "View Page Source" in the browser - then mostly yes - refer to Tom Beck's post (https://www.experts-exchange.com/questions/28708926/Is-the-content-on-a-HTML-page-all-literal-values.html?anchorAnswerId=40948839#a40948839) where he highlights that if Javascript / jQuery / AJAX code changes the content of the page - this will not show up when you do a view source on the page - it will, however, show up in the console.

The View Page source shows you what html was originally sent to the browser - any changes made by javascript dynamically would not show in this view.

But in essence, yes, if you copy the source from the page source to another page the content should remain exactly the same.
Thank you!
You are welcome.