Http protocol is stateless, so there is no native way to save some information between pages. But fortunately we have cookie in browsers. First of all, how to check if browser supports cookie: var isCookieEnabled = navigator.cookieEnabled; alert(isCookieEnabled ? ‘Cookie Enabled’ : ‘Cookie Disabled’) And when you checked that cookie …

Javascript doesn’t have foreach statement, but it’s simple to emulate one: <script type="text/javascript"> var arr = [’one’, ‘two’, ‘three’, ‘four’, ‘five’, ‘etc’]; for (var i in arr) { var element = arr[i]; alert(i + ‘: ‘ + element); } </script> It’s actually equivalent of foreach in other languages like PHP. …

Another analog of PHP’s function that obviously doesn’t work in Javascript is str_replace. Javascript has simple method of String object called “replace()”. Using of this method is very trivial: var string = "another day on the Earth!"; string.replace(’another’, ‘new’); alert(string); There is one problem – this method replaces only first …

These functions show messages passed as param, but(!) if this param is number then php interpreter thinks that param is error code and doesn’t show it. So be careful again – convert param to string before you pass something to these functions.

It seems that these functions for escaping url in js are already deprecated! You should use functions with more longer names – encodeURIConmpnent(), decodeURIComponent(). Use them to encode/decode params for url. http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp http://www.w3schools.com/jsref/jsref_decodeuricomponent.asp