var script document createElement script script src https cdn jsdelivr net npm mathjax 3 es5 tex chtml js script id MathJax script document head appendChild script document body style height 100pt let divout document createElement div divout id divout document body appendChild divout function convert var input J theta frac 1 2m sum m_ i 1 h_ theta x i y i 2 lambda sum n_ j 1 theta 2_j var output document getElementById divout output innerHTML MathJax texReset var options MathJax getMetricsFor output MathJax tex2chtmlPromise input options then function node output appendChild node MathJax startup document clear MathJax startup document updateDocument end convert script onload function convert console log ready Standard HTML Version s cript src https cdnjs cloudflare com ajax libs mathjax 2 7 4 MathJax js config default s cript J theta frac 1 2m sum m_ i 1 h_ theta x i y i 2 lambda sum n_ j 1 theta 2_j
ar options MathJax getMetricsFor output MathJax tex2chtmlPromise input options then function node output appendChild node MathJax startup document clear MathJax startup document updateDocument end convert script onload function convert console log ready Standard HTML Version s cript src https cdnjs cloudflare com ajax libs mathjax 2 7 4 MathJax js config default s cript J theta frac 1 2m sum m_ i 1 h_ theta x i y i 2 lambda sum n_ j 1 theta 2_j