javascript

Adding complex icon to the google map

I need to represent the state of some devices from the db on the google map. Each device has it's location and complex status. Something like on line / off line / camera OK etc. For each status I need to draw a bubble next to the icon on the map (e.g. one green if device is on line and one red if camera is off line). For example I have ...

make script to download all Mp3 files from a page

Hi All, I have a page that contains some links to .mp3/.wav files in that format <a href="http://siteName/subfolder/filename.mp3"&gt;File Name</a> what I need to make a script that will download all these files instead of downloading them my self I know that I can use regular expression to do some thing like that but i don't know h...

How to load local JSON files in Javascript

Hi all: I'm writing a web app (well, actually it will eventually be an OS X Dashboard widget, but I decided to prototype it first as a simple web page) that needs to load some initializing data from a local JSON file. My code looks like this: function loadDatos() { var xobj = new XMLHttpRequest(); xobj.overrideMimeType("appl...

Google Maps Remote .js and Access-Control-Allow-Origin

Hey there! I wrote a Google Maps API wrapper in JS, did some local tests with static html, and everything worked just fine. Then I loaded the files into a local web server running in localhost:8080, tested the map panels, and once again, everything worked just fine. Then a week went by, I added a map to a page, and I couldn't get it to...

Eclipse PDT - Javascript Code Assist is not work?

I thought PDT would do code assisting on JS files. Was I wrong, or is there a bug or something I am missing? ...

Security of using a long hash in the querystring to identify a dynamic document

I'm working on a small webapp that generates exercise program printouts. A user (ie personal trainer) can create an exercise program, then enter the email address of one of their clients. A link to the exercise program then gets sent to the client, like so... http://www.myurl.com/generate.php?hash=abiglonghash... The hash is a sha51...

How to give active menu item different styling

My menu is a bunch of links which I then use CSS to style as buttons <div id="menu"> <a href="" class="mybutton">Item 1</a> <a href="" class="mybutton">Item 3</a> <a href="" class="mybutton">Item 3</a> </div> When a menu item is clicked and is active, what's the best way to style it differently? Do I use jquery or javascript ...

Eclipse PDT - Javascript code hinting not working?

I thought Eclipse PDT had all the Javascript plugins and supported code hinting, but it's not working for me. Was I wrong, or is there something that needs to be set up for this to work? Thanks in advance. ...

Defer javascript execution till the content has been added to Document

I am trying to load some content into a page using Ajax. The html that is loaded contains some javascript code. Even though the code is wrapped within $(document).ready, it gets executed before the content is inserted into the document, because the parent document's Dom is ready by the time the content is loaded. How can I defer the exe...

How do i return eval(code) and get an object back with javascript

I have this bit of code. What I want it to do is is load a .js file and then run it. when it runs i want it to return a parameter or even better an object. This is the code in my page var runCode = function(){ var xhr=new XMLHttpRequest(); xhr.open('GET','io.js',false); xhr.send(); return eval(xhr.responseText); }; An...

What is the equivalent of JavaScript's decodeURIcomponent in PHP?

I have some string with unicode characters and was endcoded with javascript decodeURIcomponent.But i dont find any equivalent in php to decode it.Is there any solution for this? ...

Why Javascript doesn't include reserved keywords such as "Object", "Array", "Function", "Number" ...?

Some SPECIAL words such as Object, Array, Function, Method, Number etc are not belong to keywords in Javascrpt: Reserved Keywords in Javascript. But I have to use them carfully, they are not NORMAL words as object, array, method, number, foo ... I'd like to know how many such SPECIAL words we have? Pls give me the list. ...

Understanding HTML anchor tag

Let'u start with following example: Create three pages in same directory: test.html index.html Your test.html: <html> <head> <script> function test() { alert('Going to google.com?'); window.location="http://google.com"; } </script> </head> <body> <a href='' onclick="test();">google.com</a><br/> <input type=...

Reading JSON feed of external HTTPS site

Is it possible to read JSON feed available in another site which is HTTPS? I'm getting empty string in return. ...

Can I detect when a page extends to the right with javascript?

I am using a javascript plugin called pop (http://pop.seaofclouds.com/) to have a drop down menu. It works fine but I want to show long strings so I need the drop down box to be wide rather than long. I would love to be able to make it so that if the box that appears extends the page to the right then the box would stretch to the left. ...

mod_deflate for css and js

Hello! I'm using mod_deflate to compress my web pages but I see that only the HTML is compressed no compression for the css. Documents (1 file) 4 KB (18 KB uncompressed) http://localhost/web/ 4 KB (18 KB uncompressed) Images (16 files) 96 KB Objects (0 files) Scripts (2 files) 26 KB (73 KB uncompressed) http://code.jquery.com/j...

Event 'Window load' not work in opera with prototype

I use prototype ver 1.6.0.2 Event.observer(window,'load',function(){ function1();// function with ajax request function2();//another function with ajax request }); It work on FireFox,Chrome but in Opera it work strange Func2 and fucnc2 not runing but if page scroll down it runing both function immediately Plz help. Thanks. ...

What's the equivalent of this in plain JavaScript?

$('<span class="pictos">j</span>').prependTo('li'); ...

Javascript not executing when placed in external script file

I'm building an ASP.NET MVC site where I need a tag editor, similar to the one used on Stack Overflow. I've already looked up how to accomplish the necessary autocompletion with jQuery UI, but I've run into a problem: when I place the script in an external .js file, it doesn't execute. Here is my test.html: <html> <head> <meta ch...

Matching dynamically added events (as attributes) with jQuery

How can I match all elements that have a specific attribute that is added at run time? For example, the code: $('[onkeydown]') will successfully match: <div onkeydown="foo();"> but won't match the following div: <div id="mydiv"> // .... <script type="text/javascript"> var element = document.getElementById('mydiv'); element.onkeyd...