views:

44

answers:

2

I'm trying to teach myself Safari 5 extensions and I'm new to web development in general. Looking at the sample code, I see:

<!DOCTYPE HTML>
<script>
...
</script>

I'm just wondering, what language am I looking at? I see functions and code that almost looks C-like. Apple's documentation says it would be helpful to know HTML, javascript, CSS, and HTMl5 but I'm not sure what their samples are written in.

A: 

... is used in code examples as a placeholder, to say "insert more code here" - perhaps this is where you are confused? If you point us to the sample you are referring to, that may help to clarify.

If anything else looks unfamiliar - it may be "The Safari Extensions JavaScript API" which may contain some possibly unfamiliar looking JavaScript - from having a quick nose around - there doesn't seem to be any other technologies present.

<script> tags are used to allow inline javascript inside a HTML page - generally - w3schools is a good stop for concise explanations of HTML tags. <script> opens up the area in the page that will be interpreted as javascript code by the browser, while </script> signifies it has ended.

So the ... in this case is simply an indicator of where your custom JavaScript code should be.

The <!DOCTYPE HTML> is a HTML 5 doctype - 'an instruction to the web browser about what version of the markup language the page is written in'

Dr. Frankenstein
Ah my bad. I didn't realize Stack Overflow tried to interpret the code I pasted. I edited it. Thanks.
Travis
@Travis - No worries - amended answer
Dr. Frankenstein
A: 

From what I see, it's definitely mixed HTML5 and javascript.

digitalFresh