UPDATES VIA   RSS  |  Email Get updates via feedburner Get updates via twitter
Home

Posts tagged with JavaScript & Ajax

JavaScript: Send function as a parameter to another function (callbacks)

Posted on 29. Jul, 2009 by .

2

I’m sure you’ve seen a lot of code where functions are send as parameters, usually working as function callbacks e.g: setTimeout(function () { alert(‘test’); },1000); But how does the function setTimeout execute the passed function as a parameter? The answer is simple, but I need to provide you an example to understand it Let’s create [...]

Continue Reading

JavaScript: Get anchor from URL

Posted on 10. Jun, 2009 by .

2

To get the anchor from an URL (this is the text after the # character) in JavaScript you can use the following code: var url=’http://iwebdevel.com/some-post#comment-1′; //if you need to take the current url of the window use: var url=window.location; var anchor=url.hash; //anchor with the # character var anchor2=url.hash.substring(1); //anchor without the # character If you’re [...]

Continue Reading

JavaScript: Where do I Find All Properties for All HTML Elements ?

Posted on 08. Jun, 2009 by .

2

You think you’re good at JavaScript? Ok. Here’s a question that’ll test your JavaScript wisdom: How many properties does a DIV element have? Your answer is 5? Because there is the name, id, class, style or title property. Maybe your answer is a little bit more than 5, but would you be surprised if I [...]

Continue Reading