This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.myURL("index") // = http://spyk3lc.blogspot.com/index.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.myURL("images", "somePic.png") // = http://spyk3lc.blogspot.com/images/somePic.png | |
// Keep in mind this works for any directory ... | |
$.myURL("someDir") // = http://spyk3lc.blogspot.com/someDir/ | |
// .. and it's content | |
$.myURL("someDir", "someContent.xx") // = http://spyk3lc.blogspot.com/someDir/someContent.xx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.myURL("index", "someDir", "someContent.xx") // = http://spyk3lc.blogspot.com/index.php/someDir/someContent.xx | |
// Notice I have no need to include the .php tag as the extension already includes it via the keyword "index"! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.myURL("doit.php/your/own/way/in/one/line.gif") | |
// = http://spyk3lc.blogspot.com/doit.php/your/own/way/in/one/line.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.myURL.config({ | |
local: { | |
main: "myMainLocalDirectory" | |
}, | |
onSite: | |
{ | |
main: "myMainSiteDirectory", | |
sub: "myMainSiteSubDir/andAnotherDir" | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(a){a.myURL||(a.extend({myURL:function(d){a.myURL.defaults.base||a.myURL.config();if(d){var b,c=a.myURL.defaults.base;if("index"==d)c+="/index.php",b=Array.prototype.slice.call(arguments,1);else{if("pathname"==d)return window.location.pathname;if("afterpath"==d)return window.location.href.substr(window.location.href.indexOf(window.location.pathname)+window.location.pathname.length);if("fullpathname"==d)return a.myURL("pathname")+a.myURL("afterpath");b=Array.prototype.slice.call(arguments)}if(0< | |
b.length){var e=[],f=void 0;for(x in b)"string"===typeof b[x]?""==!b[x]&&("/"==b[x].charAt(0)&&(b[x]=b[x].substring(1)),"/"==b[x].charAt(b[x].length-1)&&(b[x]=b[x].substring(0,b[x].length-1)),""==!b[x]&&(e[x]=b[x])):"object"===typeof b[x]&&(f="?"+a.param(b[x]));0<e.length&&(c=c+"/"+e.join("/"));f&&(c+=f)}c=a.myURL.defaults.trail?c.charAt(c.length-1)?c+"/":c:c;b=c.split("/");if(b[""==b[b.length-1]?b.length-2:b.length-1].match(/.[.,!,@,#,$,%,^,&,*,?,_,~]/))"/"==c.charAt(c.length-1)&&(c=c.substring(0, | |
c.length-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.myURL("someDir", "someContent.xx", { data1: 'someString', data2: 'some Other string' }) | |
// Will produce something like: | |
// http://spyk3lc.blogspot.com/someDir/someContent.xx?data1=someString&data2=some+Other+string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A simple timer var is like | |
var tmrStopType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Again, what you name the function is clearly up to you, I wouldn't really recommend my example name as it is just plain bad :P | |
function stopType() { | |
// The following if statement will check if your timer has been assigned yet, and if so, clears it so it will no longer continue to your work function | |
if (tmrStopType!= undefined) clearTimeout(tmrStopType); | |
// The following will attempt to start your work function after 2 seconds unless interrupted and reset by previous if statement | |
// Also, many people would rather write this statement as tmrStopType= setTimeout(stopTypeWork(), 2000); | |
// If, you want to, that is fine, i don't because it is not a style of timer writing that is readable to ALL browsers, however, the following is | |
tmrStopType= setTimeout(function (){ stopTypeWork() }, 2000); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stopTypeWork() { | |
// do work | |
} |