What kind of code is http://ogp.me/ns/fb# - facebook

I'm not asking what it does, in the sense of, "It makes your Facebook Like button work."
What I am asking is, is this javascript, is it css, or what? It looks like a class. If I wanted to write my own similar file, what extension would I use to name it?
The reason I am asking is I would like to make my own class, for my own widgets, and reference my own class by putting something like xmlns:zz="http://mydomain.com/mylibrary/zz#"

It is JSON, as the name implies is a subset of JavaScript, but as it is designed for encoding data not code it can actually be parsed by most programming languages.
The extension don't matter but could be .js as it is commonly served with the MIME type text/javascript.
The is no way of using it with XML namespaces as you are hoping.

That URL redirects to http://graph.facebook.com/schema/og/#, which returns JSON.

Related

How to define custom wicket tag

I could not find a wicket tag like wicket:include? Can anyone suggest me anything? I want to include/inject raw source into html files? If there is no such utility, any suggestions to develop it?
update
i am looking for sth like jsp:include. this inclusion is expected to be handled on the server side.
To do this, you'll need to implement your own IComponentResolver.
This blog article shows an example somewhat resembling what you're after.
Is it raw markup that you want to include, or Wicket content?
If it's raw markup, even a simple Label can do that for you. If you call setEscapeModelStrings( false), the string value of the model will be copied straight in the markup. (Watch out for potential XSS attacks though.)
"Including" Wicket markup is done via Panels (or occasionally Fragments)
Update: If you add more detail about the actual problem you need to solve, there's a good chance that we can find a more "wickety" solution, after all, JSP and Wicket are two different worlds and the mindset of one doesn't work very well in the other.

How to load html head tags from one source

Okay, for static pages. Is there a way to load everything between the head tags (css,javascript,etc) from one source so we don't have to load it in every html file? I know this may be a stupid question but I couldn't find one on here and if there was already a post about it, I guess I was stupid to miss it.
If you environment permits you can use Server Side Includes http://httpd.apache.org/docs/current/howto/ssi.html which doesnt really involve using traditional dynamic scripting languages or servlet technology. In any case the HTML standard also allows you reference external CSS and JS - they dont have to be inline. If they are at the same URL they will only get loaded once by the browser.

Using custom type attribute in <script> tags such as jQuery's text/x-jquery-tmpl

I noticed that jquery's beta template plugin is using, the type attribute "text/x-jquery-tmpl"
e.g
<script type="text/x-jquery-tmpl">
I've not seen custom use of the type attribute in the past. Has anyone seen current examples of this in use or perhaps ways mere mortal developers such as I can use this in our own code?
I presume that it's sort of a MIME type, however I would of thought that MIME type support was up to the browser. So I would of assumed that custom MIME types would be unsupported?
The type actually does indicate what sort of script is there. If the browser doesn't understand it, it should ignore it. In this case, it's a convenient and semantic sort of way to include the source of the template without displaying it on the screen.
Usually with jquery template, you'll give it an id and refer to it that way with your $(id).tmpl call.
script def here:
http://www.w3.org/TR/html401/interact/scripts.html#idx-scripting_language
examples of tmpl here:
http://api.jquery.com/tmpl/
No, MIME are provided by the server to identify resources. The browser then acts on the types it recognizes.
Yes, in the HTTP connection the browser lists the types it can recognize so the server can choose types that fit better (an example here would be HTML 5 and video, where you have some codec options and the browser may support only a subset).
In this case, the specific MIME helps to signal the browser a warning: "This is not normal Javascript, don't act on it like if it was."

TTStyledText that recognizes URLs without http:// scheme

I am using TTStyledText to display text with potential markup on a TTStyledTextLabel.
If text contains something like "http://stackoverflow.com" TTStyledText autogenerates the markup and linkifies said text.
The problem is I also want "www.stackoverflow.com" to appear as valid hyperlinks, as well as anything that reasonably resembles an http URL, even if the scheme is missing.
Any way to do that with TTStyleText or do I need to recognize the URL and reformat the text myself?
I've always found TTStyledText to be woefully underpowered and missing a lot of functionality. This is a good example. I think in order to make this work you'll need to as you say pre-format the text portion before you pass it in.

Generating HTML from a template on the iPhone

I have an iPhone application which needs to generate a local HTML file from a template and then render the HTML in a UIWebView. It basically needs simple Django-like template features, just to replace template tags with values and simple enumeration over collections (for instance to generate rows of a table). Is there some existing simple template framework available for iPhone apps (implemented in C or in Objective-C of course)? I looked at Dashcode but that does not fit my needs I dont think. I have an HTML file I just want to replace values in it and enumerate/loop over collections to do it. I cant use Javascript for this actually because HTML needs to be email-able.
Thanks.
Take a look at MGTemplateEngine
https://github.com/groue/GRMustache may help you.
I've written a simple tempalte class once. It had <%= foobar %> style tags in it. I would call [myTemplate setValue:#"I like SO" forVar:#"foobar"] which would find the tag and replace it.
Looping and enumeration might be much harder. Maybe there is a ObjC templating library out there that I don't know of.