javacsript

Why do so many Javascript scripts append random numbers to things? Collision?

I've been learning JavaScript recently, and I've seen a number of examples (Facebook.com, the Readability bookmarklet) that use Math.rand() for appending to links. What problem does this solve? An example parameter from the Readability bookmarklet: _readability_script.src='http://lab.arc90.com/....script.js?x='+(Math.random()); Are t...

How do I send formated html emails?

I have a page where a user can "share" the page with other people. I want the email to be formatted with html. I'm using javascript to send the email. Any Idea's? ...

search submitbutton in all forms with textareas with jquery

Hi there i'm working on a ff-plugin which searchs a webpage for all textareas and places a warning before the submit button. my code looks like this var submitWarning = content.document.createElement("div"); submitWarning.innerHTML = "Fancy Message"; $('textarea', window.content.document).each(function() { var form = $(this, windo...

Javascript get all the radio with the same id

I have an web form that have 5 radio button with the same id. how i can catch all the radio in a vector from javascript? ...

javascript enabled/disabled in browser

How to find whether user has enabled or disabled javascript of the browser or the bowser do not support javascript. ...

Include various Javascripts without getting "unterminated string literal" error?

I get the "unterminated string literal" error with this code. This code used to work by using escaped quotes. Not possible now because because Google Adsense is including several script files. <script type="text/javascript"> <!-- var t=0; var myArray = []; myArray[0]= 'condition1'; myArray[1]= 'condition2'; myArray[2]= 'condition3';...

Debugging in mobile browsers?

I'm developing a web-application using HTML5 canvas and I need to debug in mobile browsers. Normally I'm using firebug in Firefox and the built-in developer tools in Chromium for this, but I need to do some of the same on the iPhone and on Android-based phones, like the HTC Hero. ...

How to strip slashes in Javascript (json)? Any JQuery plugin?

So, when I save the data into database, PHP will add a \ on single or double quote. That's is good. However, when data passing back to client using json_encode(); TEXT like McDonald's is STORED as McDonald's in DB but once pass back from PHP to js, it will be encoded as McDonald\'s Since I'm using jQuery, is there any plugin easily ...