javascript

Is there an onload event for input elements?

Is it possible to trigger a Javascript script, when an input element or any other html element is rendered. This script should be triggered from within the html tag, so that we should be able to pass 'this' to the js function. ...

How do I assign a javascript variable to a PHP variable?

Hello, I have a javascript variable which holds some information and I want that to assign in a PHP variable. Here is what I am using: <script type="text/javascript"> function redirectToFacebook() { var facebookMessage = encodeURI(document.getElementById('txt_msg').value); } </script> <?php $_SESSION['sess_facebook_message'] =...

How to add a click event to p elements in iframe (using jQuery)

How to add a click event to <p> elements in iframe (using jQuery) <iframe frameborder="0" id="oframe" src="iframe.html" width="100%" name="oframe"> ...

Dropdown list value when enabling and disabling through javascript.

I am using a asp.net Drop down list control which is disabled using javascipt, when I am trying to retrieving the value server side the default value is being set on postback. It is a Web Project and Iam using VS2008. ...

Project ideas to master JavaScript

This question is the following of my other question here: http://stackoverflow.com/questions/3707746/cannot-understand-node-js I decided to learn JavaScript, however and in spite of I learn by doing, I don't find anything I can be doing in order to learn JavaScript. What projects do you recommend me to start? What cool things can I do ...

Elegant way to init and extend a javascript array

Is there a sweet way to init an array if not already initilized? Currently the code looks something like: if (!obj) var obj = []; obj.push({}); cool would be something like var obj = (obj || []).push({}), but that does not work :-( ...

How do I write .level+1 as a selector in JQuery or JavaScript?

Hi All, A quick question. I have a series of DIVs with the following classes .level1 .level2 .level3 This is what I want to happen...When I hover over .level1 I would like the selector to select .level2. In other words .level+1 whatever I hover over. How do I write this in JavaScript or JQuery ...The X in the code is where I need this...

error after submit a form

Hi, i have a php like this: <?php ...... ?> <html> <head></head> <body> <div id="content"> <form id="myform" name="myform"> <?php include_once("ronny.php"); ?> ..... <input type="button" value="Save" id="Save" name="Save" onclick="if(check123()==true){document.myform.submit()}" /> </div> </form> ... Now, in this case after i click on...

Is there any event for re-focus the page of browser?

I left the page or browser for a while and come back to the page after a while. Is there any event for the re-focus? ...

How to achieve this javascript effect?

On this website: when the user clicks "register now" along the top bar the screen goes dim and a box appears offering the registration form with recaptcha. I have a registration form with recaptcha working on my site and would like to copy the effect seen above. Can anyone link me to a specific tutorial offering instructions or alternat...

Node.js base64 encode a downloaded image for use in data URI

Using Node v0.2.0 I am trying to fetch an image from a server, convert it into a base64 string and then embed it on the page in an image tag. I have the following code: var express = require('express'), request = require('request'), sys = require('sys'); var app = express.createServer( express.logger(), express.bodyDecoder() );...

Call server side function from client side javascript

Possible Duplicates: how to call server side function from client side - asp.net Calling ASP.NET Code Behind function from Javascript Calling ASP.NET server side method via JQuery hi guys, While loading an aspx page, how is it possible to call a server side method with the client side code?Can u show one example? ...

Ajax issue: delay in getting data from web service using innerHTML, please guide

I am working on an ajax application which will display about a million records in an html table. Web service returns records from server, I build a logn string by concatinating data and tags and than put this string using innerHTML (not using DOM for getting better performance). For testing I have put 6000 recods in database (stored pro...

CKEDITOR.replace() is hiding the textarea that I want converted

I'm using Javascript to create a textarea that I want to be a ckeditor. My code is something like var html = '<textarea name="text"></textarea>'; $('#mydiv').append(html); var textareas = document.getElementsByTagName('textarea'); // Could be more than one textarea for (i = 0; i<textareas.lenght; i++) { var textarea = texta...

javascript escaping //

how will i escape the slashes // in javascript var j = /^(ht|f)tp(s?)://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$;/ ...

Why doesn't jQuery bomb if your selector object is invalid?

Was recently using some code along the lines of $("#divMenuContainer:visible").hide("explode"); However after some time spent trying to get it to work I realized my selector was referencing a div that didnt exist. The result of the query was simply that it didn’t execute. Obviously this is by design, could anyone explain the logic...

Javascript encoding decoding problem

I have the following javascript var cst = "\x26"; var other = $("#D1").html(); And my html has D1 div like the following <div id="D1">\x26</div> Now when I add a breakpoint and see my two variables cst and other. One is shown & and another \x26. Also cst.length == 1 but other.length == 4 I am confused. I need the...

Managing large sets of Images using Javascript on MobileSafari

I'm looking at ways to manage a large set of images within Mobile Safari for iPad. In this case I have a web app that will move the images using webkit CSS3 animations (supposedly taking advantage of hardware to do so). I've noticed that if I have more than 10 large images (200-300K each) I hit large performance issues. Animations are j...

jquery color variation

I need to produce all 255/256 color variations of a given color, is there some advice to start, or a jQuery lib to use? Thanks in advance. ...

jQuery object passed as argument to function is value copy not reference?

My understanding: in Javascript objects and arrays get passed as references not values for function arguments. A jQuery group is an object and hence should be passed as reference. However I'm finding in the test script below that something strange is going on; the jQuery group is behaving like a value not a reference unless wrapped in a...