JavaScript

JavaScript escape HTML characters

This article provides a sample implementation in jQuery to escape HTML characters suitable for pasting into text area inputs. Escape of HTML characters can be easily achieved with jQuery. jQuery support the .html() function to get HTML contents of the first element in the set of matched elements or set the HTML contents of every …

JavaScript escape HTML characters Read More »

Javascript pie charts using jQPlot

Javascript Pie Charts using jQPlot This article provides a sample implementation to draw charts using JavaScript solutions. jqPlot http://www.jqplot.com/ is a versatile and expandable jQuery plotting plugin and supports pure client side Javascript charts. jqPlot support numerous chart style and options. It is free and open sourced under GPL/ MIT license. Pie chart demo HTML …

Javascript pie charts using jQPlot Read More »

Javascript scroll to bottom of page

This code snippet provides a JavaScript function to scroll a HTML page programatically to the bottom on page load. Make the browser height smaller to observe the scrolling effect. The javascript. Store it in your JavaScript file, here “testme.js”. window.onload=toBottom;function toBottom(){alert(“Scrolling to bottom …”);window.scrollTo(0, document.body.scrollHeight);} The test html code. <html><head><script src=”testme.js” language=”javascript” type=”text/javascript”></script></head><body>Some big text<br/>Some …

Javascript scroll to bottom of page Read More »