Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
173 views
in Technique[技术] by (71.8m points)

javascript - View page source Angular Universal with Angular 11

After user actions trying to update the script type application/ld+json src in angular Universal.

const script:HTMLScriptElement  = document.createElement('script');
script.setAttribute('type', 'application/ld+json');
script.setAttribute('src', 'assets/data/bangalore-to-hyderabad-schema.js');  
this.dom.body.appendChild(script);

But in elements body section is updated not in view page source under body section. Any help? thanks in advance.

question from:https://stackoverflow.com/questions/65600495/view-page-source-angular-universal-with-angular-11

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It is normal. If you update dynamically the dom after a user action without reloading the page, then you will not see the modifications using View Source.

View source only shows you what the server sent to the browser, but none of the client side modifications


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...