Another language supported by "some" "browsers" is VBScript, but .. you don't want to go there.
Support for other languages is still ongoing.
Today you can have a framework or library for translating one language into JavaScript
Here are some of them along with a small sample:
GWT - Java
Button removeStockButton = new Button("x");
removeStockButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
int removedIndex = stocks.indexOf(symbol);
stocks.remove(removedIndex);
stocksFlexTable.removeRow(removedIndex + 1);
}
});
stocksFlexTable.setWidget(row, 3, removeStockButton);
Pajamas - Python
def greet(sender):
Window.alert("Hello, AJAX!")
CofeeScript - (like Ruby)
square: (x) -> x * x
cube: (x) -> square(x) * x
Pyscript - (similar to Python)
function triangle(a,b):
function sqroot(x): return Math.pow(x,.5)
return sqroot( a*a + b*b )
From this, GWT is the most reliable.
source
share