function getBaseURL () { return location.protocol + "//" + location.hostname + (location.port && ":" + location.port) + "/"; }
Month: July 2012
To use the cache helper in any view or controller, you must first uncomment and set Configure::Cache.check to true in core.php of your app/config folder. If this is not set to true, then the cache will not be checked or created. Configure::write('Cache.check', true);
use the useful callback disableCache(), that will tell the user’s browser not to cache the results of the current request. This is different than view caching. The headers sent to this effect are: Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: [current datetime] GMT Cache-Control: no-store, no-cache, must-revalidate Cache-Control: post-check=0, pre-check=0 Pragma: no-cache
the fastest way to get selected value text from a dropdown is using: $('#dropdown_id').children("option:selected").text()
In JavaScript null is an object. There's another value for things that don't exist, undefined. The DOM returns null for almost all cases where it fails to find some structure in the document, but in JavaScript itself undefined is the value used. To check for null if (null == yourvar) // with casting if (null … Continue reading How to check a not defined variable in javascript
Let's see this question: //Assume function example1(){ echo 'example 1'; } //,and function example2(){ echo 'example 2'; } //True or False var_dump( ( example1() == example2() ) ); This will result to TRUE, but why? cause both functions example1() and example2() doesn't return anything (doesn't have a return statement) so it is called (void) function … Continue reading are these functions identical