javascript

Find out the post data size in byte.

When I submits the form in php. I want to find the size of the data for each text box that are posted through javascript in bytes. ...

Is there any clever way for Javascript to know its being executed in an iFrame?

I need the script to dynamically change how it functions if the page is embedded via an iFrame. The script will be called in the iFrame source from a <script.. tag and wont be inline javascript. Thank You in Advance! Update: David provided this answer which works in Firefox and Chrome but doesn't work in IE8, any help with this i...

Javascript VS C#

Maybe a strange and green question, but Is there anything C# can't do what javascript can... And considering JQuery? except for the fact that one is clientside, and the other serverside? Or am I asking a very stupid question now? EDIT: to be more specific: I mean web programming, and indeed maybe a more useful question is: > What can...

DOM Element Width before Appended to DOM

I'm sure the answer is no, but is it possible to determine the width of an element before it is appended to the DOM? Once it's appended, I know I can use offsetWidth and offsetHeight. Thanks ...

How can I find a text node in the live DOM using its copy/clone?

I've copied some text nodes from the page (i.e., live DOM) and have stored them in an array. Is it possible to locate those exact nodes again in the live DOM? I would need to use plain JavaScript. This is basically how my project works: A configuration object specifies sections of the page (using CSS selectors) where there is some tex...

html/js: Refresh 'Select' options

Hi, There's a class 'Car' with brand and model as properties. I have a list of items of this class List<Car> myCars. I need to represent 2 dropdowns in a JSP page, one for brand and another for model, that when you select the brand, in the model list only appear the ones from that brand. I don't know how to do this in a dynamic way. An...

How would I get data of the following format?

Wed, 26 May 2010 03:57:59 GMT ...

how to change picture using drop down list ?

Hello, I want to use a drop down list, every time i click the content in it, different pictures will show up. But i don't want to use the property 'value', because i want to use the values for other use. Example: <select name='test'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value...

jquery ui dialog button

Hello, With a jQuery UI dialog, I need to be able to set tooltips on buttons... I have the following code: buttons: { 'My Button' : function(e) { $(e.target).mouseover(function() { alert('test'); }); } This allows me to do something on "mouseover" but only once the button has been clicked. What do I need to do in or...

Moving rails javascript to public while keeping ruby code?

Hi guys, I have a project to move some JS code outside of rails into the public direcotry, but some of it has ruby code embedded, and depends on the values of the variables from the controllers to set some of its code. How can I move it out of the view and still maintain the same structure, or do I need to just rewrite the JS from scrat...

Image Preloading in Canvas

I'm drawing an Image on the canvas using the drawImage function. This is how Im setting the src property of the image: var img = new Image(); // Create new Image object img.src = 'test.php?filename=myfile.jpg' and then oCanvas.width = 600; oCanvas.height = 400; oContext.drawImage(img, 0, 0, 600, 400); The problem ...

How to make cross-domain AJAX calls to Google Maps API?

I'm trying to make a jQuery $.getJSON call to the Google Maps Geocoding webservice, but this doesn't work because of cross-domain security issues. I haven't been able to figure it out online, but I've read a bit about Google Javascript API or JSONP, but so far no clear answer... Could anyone enlight me? Thanks! ...

CSS doesn't apply to dynamically created elements in IE 7?

Still looking for an answer. Changing or reassigning to the filter's innerHTML successfully redraws the element, but breaks my script, so that's out. Adding additional child nodes, including text nodes, does not force a redraw. Removing the added node does not force a redraw. Using the ie7.js family of scripts does not work. In the...

JQuery datepicker

Coud someone help me with this? I am getting these question marks in the graphic and i'm not sure why? I have seen these symbols before and i am sure it had something to do with charset. I am using: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> Here is my JQuery code <script type="text/javascript"> ...

IE8 (compatibility mode) won't load my Ajax content

Hi all - I am working on a jQuery script on http://www.qxl.dk/ and I can't seem to get IE7 (or more accurately, IE8 in IE7 compatibility mode) to load my content. The sidebar box on the right named "QXL Aktuelt" loads its HTML content from an external file using Ajax load(), then triggers a custom jQuery event ("aktuelt_loaded") that st...

How to access frame (not iframe) contents from jQuery.

Hello I have 2 frames in one page like this (home.html) <frameset rows="50%, 50%"> <frame id="treeContent" src="treeContent.html" /> <frame id="treeStatus" src="treeStatus.html" /> </frameset> and then in one frame (treeStatus.html) I have something like <body style="margin: 0px"> <div id="statusText">Status bar for...

The alt text of an image shown should stay visible for at least 7 seconds on each rollover.

I need to display the alt/title text of an image stay visible for at least 7 seconds on each rollover. ...

Alert Box Methods

I just need a little advice on what may be the best method for handling my situation. I'm in need of placing three buttons in the sidebar of the website I maintain. The website is massive and hard to handle. Currently, it's all HTML files (there are over 10,000 of them believe it or not). We're transitioning to a database website so I d...

how to get redirect url from ajax handler in c#

i am sending a request to ajaxhandler i want if the user is not logged in then it sends back a redirect url to login page and the page automaticaly redirects to login page after the ajaxrequest response ...

Adding a link using JQuery html() is not click-able on IE6

Hello all, I add html to a page using JQuery's html() function. This works great on most browsers except IE6. I can work round this by adding a click event etc but I want to fix the issue without extra tape! Any ideas why this doesn't work on IE6? $('#button_holder').html('<a href="#" onclick="run_activity_upload(); return false;" id...