I am currently trying to get a radio stream from ShoutCast to play with JPlayer with no success. Ideally I would like a pls file such as this one http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377246 to play with JPlayer. Here is my current code: Not sure whether this is possible or not but I would appre…
Tag: javascript
Open a new tab in the background?
Using javascript, I want to open a new page in a different tab, but remain focused on the current tab. I know I can do it like this: However, when I do this in chrome, it flashes the new tab for a moment before switching back to the current tab. I want to avoid this. The application is a personal
Load HTML in WebView with local css and js
I am displaying a webview with a remote html content get as a string from a remote server. I store the html locally for a no connection use of my application. Moreover I also store a .js script and a .css style file locally. These files can be updated by the server. I store all these files at the following
How can I remove or replace SVG content?
I have a piece of JavaScript code which creates (using D3.js) an svg element which contains a chart. I want to update the chart based on new data coming from a web service using AJAX, the problem is that each time I click on the update button, it generates a new svg, so I want to remove the old one
JavaScript: Detect AJAX requests
Is there any way to detect global AJAX calls (particularly responses) on a web page with generic JavaScript (not with frameworks)? I’ve already reviewed the question “JavaScript detect an AJAX event”, here on StackOverflow, and tried patching in the accepted answer’s code into my appli…
multiple image uploads, display all,drag-drop from all [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I am new to Jquery and ajax. I need to upload multiple images to server fol…
Scaling HTML5 canvas width preserving w/h aspect ratio
I have a canvas element with dimensions of 979X482px and I’d like to have it stretch to fit the width of any given browser window, keeping the aspect ratio of width/hight 1 to 1, I want the height to scale relative to width of the canvas. Any suggestions as how to go about doing this with javascript/jQu…
Detect touchpad vs mouse in Javascript
Is there any way to detect if the client is using a touchpad vs. a mouse with Javascript? Or at least to get some reasonable estimate of the number of users that use touchpads as opposed to mice? Answer In the general case, there is no way to do what you want. ActiveX might allow you to see and examine
Random alpha-numeric string in JavaScript?
What’s the shortest way (within reason) to generate a random alpha-numeric (uppercase, lowercase, and numbers) string in JavaScript to use as a probably-unique identifier? Answer If you only want to allow specific characters, you could also do it like this: Here’s a jsfiddle to demonstrate: http:/…
Finding all indexes of a specified character within a string
For example, if I had “scissors” in variable and wanted to know the position of all occurrences of the letter “s”, it should print out 1, 4, 5, 8. How can I do this in JavaScript in most efficient way? I don’t think looping through the whole is terribly efficient Answer A simple …