Skip to content

Tag: javascript

Javascript to list all files in directory on the webserver

I know how to do this in server side languages but I was wondering if there is an easy way (as in no active X). Google searches only give me ways for javascript to list files from the user’s computer. How can I use javascript to list all files on the server. That is, if I have a folder /gallary

Transform JSON Object to another – Format It

I want to transform a JSON formatted output to another. How I can do this? Example: Old JSON New JSON which I want without braces only like this with bracket Answer You could just loop through the items and push them into a new object: example: https://jsfiddle.net/q2Jzb/1/ You are presumably passing these to…

Convert slug variable to title text with javascript

I’m trying to do something that would be similar to turning a url slug-like variable into text that could be used for a title. So, I have a variable for example that is like this: I’d like to not use a regex to do this if possible somehow, but I don’t think there’s a way to do it witho…

Cross-domain connection in Socket.IO

Is it possible to use Socket.IO in a cross domain manner? If so, how? The possibility is mentioned around the web but no code examples are given anywhere. Answer Quoting the socket.io FAQ: Does Socket.IO support cross-domain connections? Absolutely, on every browser! As to how it does it: Native WebSockets ar…

DOM change event for Opera

So far I found how to do it in Chrome, the DOMSubtreeModified event: Is there a JavaScript/jQuery DOM change listener? Apparently it works in Firefox and IE 9 too. Do you know solutions for detecting DOM changes in other browsers such as Opera? And maybe older versions if IE, because I’m sure the event …