javascript

why does firebug debugging sometimes work and sometimes not?

I want to debug a javascript file that is embedded in the HEAD element. I navigate to the site, see the code, and make a breakpoint: But when I click on Reload, the script disappears and it doesn't stop at the breakpoint: Debugging was working earlier so I know it works in general. What do I have to do so that Firebug always debug...

How to convert a DOM node list to an array in Javascript?

I have a Javascript function that accepts a list of HTML nodes, but it expects a Javascript array (it runs some Array methods on that) and I want to feed it the output of Document.getElementsByTagName that returns a DOM node list. Initially I thought of using something simple like: Array.prototype.slice.call(list,0) And that works fi...

Is it possible to pop open the upload file dialog without requiring the user to press Browse?

I think I've seen Gmail do it in Chrome or Internet Explorer, but I've never seen it in Firefox. I thought I'd ask anyways. Is it possible to do a file upload without requiring an <input type="file" />? I see that you can use iframes to automatically submit the file input, so my question is Can you programmatically pop up a file upload...

What are the frameworks for creating HTML5 <canvas> applications?

Yesterday I ran across the jcotton framework for creating canvas applications and I was wondering what the state of the art is. Do other such frameworks exist? If so what are their [dis]advantages? ...

how to change id of table cell using javascript

I have tried this, but not working. tbl1.rows[0].cells[0].id ='myId'; and this is also not working tbl1.rows[0].cells[0].setAttribute("id","newid"); how can I do this? EDIT: When view the page source the id is not changed, but when we check using Firebug, then there is shown new Id. Thanks ...

Updating table row by given id with jQuery

Hello all! I need to update a specific table row (via tr id="unique_key") after a successful AJAX call. HTML fragment: <a name=\"p{$product_id}\" class=\"tr{$product_id}\"></a> <tr id="p{product_id}" class="item-row"> <td><h3>{product_id}</h3><a rel="facebox" href="ajax_url">{product_name}</a></td> <td>{image_information}</td> <td>{im...

DatePicker Javascript

I am in need of date picker javascript which allows date in mm/dd/yy format. And also it should have good resolution and should be non-popup based. I searched in google but not getting my exact requirements. Plz suggest me the proper source. Thank You. ...

how to change behavior of contenteditable blocks after on enter pressed in various browsers

When pressing enter in <div contenteditable="true"> </div> in firefox <br /> is produced - that's ok. But in Chrome or IE a new <div> or <p> is created. What should I do to make Chrome and IE behave like Firefox . ...

Modify the server side functions using jquery

Hi, I am developing one website using cakephp and jquery technologies. Server-side there are some functions which handles sql queris. As per requirement I want to modify server side functions on client side using jquery AJAX call. E.g. : Below is the function on server side to modify users information. function modifyUser(username,us...

Why do browsers allow switching off Javascript?

Am curious why modern browsers allow switching off Javascript. It's so clear now that to do any substantial modern web application you need to integrate some high level of Javascript, why cant javascript be made an integral part of the browser? It becomes even more annoying especially when this option is OFF by default (IE!!) My opini...

Make Google index backlinks(SEO) inserted via javascript

Is it possible to insert backlinks(SEO) via javascript so that they could be indexed by Google bot? My only guess was to put javascript dom manipulation script at the top of document, before document.ready. Will google index those links? ...

Convert Google results object (pure js) to Python object

So I'm trying to use Google Map suggest API to request place name suggestions. Unfortunately I can't find the docs for this bit. Here is an example URI: http://maps.google.com/maps/suggest?q=lon&amp;cp=3&amp;ll=55.0,-3.5&amp;spn=11.9,1.2&amp;hl=en&amp;gl=uk&amp;v=2 which returns: {suggestion:[{query:"London",... I want to use this ...

Adding images to the html with javascript

I've tried some HTML DOM code from several sites, but it isn't working. It isn't adding anything. Does anyone have a working example on this? this.img = document.createElement("img"); this.img.src = "img/eqp/"+this.apparel+"/"+this.facing+"_idle.png"; src = getElementById("gamediv"); src.appendChild(this.img) But it isn't adding anyt...

Why Won't the WebSocket.onmessage Event Fire?

Hey guys, After toying around with this for hours, I simply cannot find a solution. I'm working on a WebSocket server using "node.js" for a canvas based online game I'm developing. My game can connect to the server just fine, it accepts the handshake and can even send messages to the server. However, when the server responds to the clie...

Drawing a path with a line in OpenLayers using JavaScript

I have seen the examples presented here of how to draw a line but the examples only show how to do it with the mouse, by clicking. What I want to do is draw the line manually using JavaScript given a list of Longitude and Latitude coordinates. The reason I cannot work on the source provided in the link above is because they are only ca...

Javascript: window.onload problem

This isn't working in IE (although it does work in FFX). Why? Using HTML in the header: <script type="application/javascript"> // And finally, let's call the code ourselves. window.onload = lbp.init; </script> And then the script: // lbp is the script's universal variable, which retains everything var lbp = {}; // The se...

Why mysql is not storing data after "#" character?

Hey Friends, I have made one form in which there is rich text editor. and i m trying to store the data to database. now i have mainly two problem.. 1) As soon as the string which contents "#"(basically when i try to change the color of the font)     character, then it does not store characters after "#". and it also not store "#" char...

how to match all language characters like english, greek, chinese except the special characters

I have a display name field which i have to validate using JavaScript regex. We have to match all language characters like chinese, german, spanish in addition to english language characters except special characters like *(). I am struck on how to match those non-latin characters. Any help appreciated. ...

Complex jquery selction that also involves custom xml tags

I want to write a select something like... #window_4 > content > p:eq(0) I think I have this correct, but I have a few selectors that are all similar but I can't test them all at once. Am I right in saying this is selecting an element, who is the fist p tag child of a content tag that is a child of a tag with id 'window_4' If I have...

ExternalInterface

Hey, so I'm having a bunch of trouble getting ExternalInterface to work, which is odd, because I use it somewhat often. I'm hoping it's something I just missed because I've been looking at it too long. The flash_ready function is correctly returning the objectID, and as far as I can tell, everything else is in order. Unfortunately, wh...