I want to write formulas in Mathematica format in my blog, inside tag's formula. What js should I use (and wh开发者_开发百科at libary), to replace those tag's, with http://www.wolframalpha.com/ search result image, when Dom gets loaded?
For example:
<formula>Limit[((3 + h)^(-1) + -1/3)/h, h -> 0]</formula>
gets replaced with:
If it's to complex or can not be done with javascript, please explain why.
You need to use wolframalpha API service, but it's not free and you can't do this using javascript because of same origin policy, only using server-side language.
It seems that your real question is: "how do I get nice math on Blogger.com", so I will answer this instead.
A proven solution (see e.g. Psychedelic Geometry, no affiliation) is to use the MathTex system by John Forkosh (who also hosts a public cgi) together with the ReplaceMath script by Randall Farmer. Browse some source for modified versions of the script.
Installation is a matter of including a single javascript file, after which you can inline LaTeX in your html as $latex <some LaTeX to be png'ified> $
.
If you want to format output from Wolfram Alpha then @antyrat is correct. But if you just want to write nice-looking mathematical expressions for your blog you should look at Presentation MathML and LaTeX. There is a variety of utilities for rendering LaTeX into gif or png or similar formats.
精彩评论