Some time ago I’ve tried to pass form data with AJAX without using any framework. my jQuery or Mootools. They are great scripts but in most of my cases they over-do the job, so therefor I’ve tried to do it myself, at first I managed to send the post data BUT the format was wrong. anyway to make a long story short here is how I did it.
Read the rest of this article
Tags:
AJAX,
Javascript,
programming
Hi there!
i was looking for a javascript code to get the level of the browser location with javascript. I could not find anything usefull therefor I’ve written a piece of code. I hope you find it usefull. This script will output the exact number of directories you are in.
ie.
http://www.yourdomain.com/ -> 0
http://www.yourdomain.com/dir1/dir2/dir3/ ->3
var TheURL = location.href;
var CleanUp = TheURL.replace(/http:\/\/([0-9a-zA-Z._])*\//,"")
var TheDir = CleanUp.split("/")
var TheCount = TheDir.length-1
document.write(TheCount)
Leave a comment if you think this code was usefull.
Tags:
Javascript