mgreer58 Posted February 17, 2018 Report Share Posted February 17, 2018 I'm a fair way into the HTML 2015 course, and, maybe you will answer the question later on in the course, but, how does the browser know how to implement the different web page design languages, such as HTML 5, CSS, JavaScript, PHP? I was amazed that you can just type a CSS keyword "style" into an HTML 5 webpage script, and the browser automatically implements it. I'm old enough to know that I don't have to know all the gory details of how something works, in order to use and enjoy that it does, but, still, the "need to nerd" in me, would like to know. My guess is that browsers need to be updated for the latest and greatest web design languages as they are created? -Mike Quote Link to comment Share on other sites More sharing options...
administrator Posted February 17, 2018 Report Share Posted February 17, 2018 Hi, For HTML, CSS and JavaScript, the web browsers 'know' what to do because the code has a particular structure that tells the web browser what kind of code it is. For example, with HTML, the tag structure with the angled brackets tell the browser it is HTML. For CSS, it can see CSS with the style attribute or the CSS tag block. With JavaScript, it is the script tag block. With PHP, you have to create a PHP page (ex: index.php) ... and when the web server see's the PHP extension, it passes the page to the PHP engine, and it knows how to find and read the PHP code. Makes sense? Stef 1 Quote Link to comment Share on other sites More sharing options...
mgreer58 Posted February 18, 2018 Author Report Share Posted February 18, 2018 In a very general sense, it answers my question. It's obvious to me how the browser knows how to distinguish the three types of code, my question has more to do with the inner workings of browsers. Maybe I'm overthinking, unnecessarily, the issue. It seems to me, that in order for the browser to implement all three separate web page design languages, it has to act as a compiler that can compile three different computer languages. Well, I guess part of the answer is that it's not a compiler, it's an interpreter. And, I've actually read of scripting another programming language to perform functions from inside another programming languages code. For example, scripting Python inside C++ code. I'm rambling at this point, but, I was just curious about browsers conceptually. It seems to me, that they must be updated and patched every time another code is developed to program web pages. -Mike Quote Link to comment Share on other sites More sharing options...
administrator Posted March 8, 2018 Report Share Posted March 8, 2018 On 2/18/2018 at 1:09 AM, mgreer58 said: Maybe I'm overthinking, unnecessarily, the issue. Yep. On 2/18/2018 at 1:09 AM, mgreer58 said: it's an interpreter. Yep again. There are 'engines' (programs) built into the web browsers that process the code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.