admin管理员组文章数量:1435859
- In my app I want to process Google Translate definitions, like definition for the word "song"
- When I check returned http message, it does NOT contain the "short poem" expression.
- But in DOM tree view in Safari I can see the "short poem" info.
- This is because after loading page some JavaScript code do some
magic? How would you get
DOM tree
in an iOS app?UIWebView
can do such a magic?
- In my app I want to process Google Translate definitions, like definition for the word "song"
- When I check returned http message, it does NOT contain the "short poem" expression.
- But in DOM tree view in Safari I can see the "short poem" info.
- This is because after loading page some JavaScript code do some
magic? How would you get
DOM tree
in an iOS app?UIWebView
can do such a magic?
- If you want to access Translate programmatically, you should use the API, not their html frontend (which is both technically cumbersome and a violation of their TOS). – georg Commented Mar 26, 2015 at 8:14
- @georg it's paid service, I assume he's trying to workaround that – setec Commented Mar 26, 2015 at 8:16
- Google Translate API cost money even if it is cheap, but the real downside that the english definition / synonyms are not available with API, and I need that – János Commented Mar 26, 2015 at 8:16
1 Answer
Reset to default 7The notions between a page's source and a page's DOM are similar, but different. The source is the raw HTML that is unadulterated by any client-side scripts. It is the direct response of the HTTP request to the server. The DOM, on the other hand, is the same HTML structure that has been modified by JavaScript.
Source Code reads the page's HTML as if you opened it in a text editor. The source code reflects your HTML structure before any JavaScript is loaded. While the contents can’t be edited, it’s useful to see the HTML the browser receives from the server.
https://developer.apple./library/mac/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/ResourcesandtheDOM/ResourcesandtheDOM.html
Try to read about API, I think there are API's for translate and stuff
本文标签: javascriptWhat is the difference between source code and DOMStack Overflow
版权声明:本文标题:javascript - What is the difference between source code and DOM? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744503893a2609477.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论