Skip to content
Advertisement

How to get caller element using JavaScript?

I have a table with id “tbl” and it has 2 rows and 3 cols. Each cell (td) has an explicitly defined id. Also, the table has an onclick event that calls a function foo(). The onclick() would be generated whenever any cell is clicked. The table tag is: I also tried javascript:foo(this) I want to find out the id

AJAX Problem – No response text in FireFox, but ok in IE

I am making a simple AJAX call to an external site. It works ok in IE, but in Firefox, not response text is returned. I think it might have something to do with the response being “chunked”, but I’m not sure. Any ideas? Thanks. Answer Is your page hosted at http://drc.edeliver.com.au also? If not, then you can’t make an XMLHttpRequest

getting file size in javascript

given a path of a file like: C:file.jpg how can i get the size of the file in javascript? Answer If it’s not a local application powered by JavaScript with full access permissions, you can’t get the size of any file just from the path name. Web pages running javascript do not have access to the local filesystem for security

jQuery Youtube URL Validation with regex

I know there is plenty of question answered over here https://stackoverflow.com/questions/tagged/youtube+regex, but not able find a question similar to me. Any body has the JavaScript Regular expression for validating the YouTube VIDEO URL’s line below listed. Just want to know where such a URL can be possible — update 1– — update 2– This one worked almost fine, but failed

When iterating over values, why does typeof(value) return “string” when value is a number? JavaScript

I’m using Google Chrome for this test: Contrary to intuition, the first loop alerts “string” three times, while the second loop alerts “number” three times. I was expecting both loops to alert “number” three times. How is the first loop implemented in JavaScript? In other words, if the for-each is syntactic sugar, what is its equivalent using a standard loop?

What makes an input vulnerable to XSS?

I’ve been reading about XSS and I made a simple form with a text and submit input, but when I execute <script>alert();</script> on it, nothing happens, the server gets that string and that’s all. What do I have to do for make it vulnerable?? (then I’ll learn what I shouldn’t do hehe) Cheers. Answer Indeed just let the server output

Advertisement