javascript

How to run a jQuery function after all and any other javascript has run

hey guys, I have a photo gallery page hosted on a CMS (Squarespace) which has some of it's own scripts which load the thumbnails asynchronously. The actual large images however are not preloaded, so I decided to add my own script into the mix to just make the browser load those larger images into the cache in the background, like this:...

Growing into JavaScript as an integral part of the front-end vs. 'DHTML'

More of a general question here. At the moment a lot of the projects I work on utilize server-side views to render the user interface, and spruce it up with some JavaScript here and there. That is all fine and dandy for smaller projects, but lately it seems like the .js files are growing rather large in size, and the stacks upon stacks ...

Get the Size of a CSS Background Image Using JavaScript?

Is it possible to use JavaScript to get the actual size (width and height in pixels) of a CSS referenced background image? ...

How can I change this to sort by time too?

Hi I want to sort by Month Day Year Hour Minute PM/AM (MM/dd/yyyy h mm tt) I want to change this what does dd/mm/yy However I am not sure how to do this jQuery.fn.dataTableExt.oSort['uk_date-asc'] = function(a,b) { var ukDatea = a.split('/'); var ukDateb = b.split('/'); var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * ...

Question mark in regular expressions in Javascript (weird behaviour).

<html><body><script> var matches = /(\w+)(\s*(\w+))?/.exec("aaa"); alert(matches.length); alert(typeof(matches[3])); </script></body><html> I'm really new to regular expressions, so this may be a very easy question. The regular expression above /(\w+)(\s*(\w+))?/ matches patterns like "aaa", "123", "my_var" or "aaa bbb", "123 456", "m...

How to use jquery to create progress bar for loading an image?

I want to take size in bytes of image in page at the first load page, and then create a loading bar and show it loading similar preloader of flash. But I don't know if jQuery can take size in bytes of image or not. ...

Enabling and Disabling Save button on a GWT page

The application I am working on has pages of setup data with lots of textboxes; each page having a save button. I have defined most of the pages as a *.ui.xml file and used the GWT 2.0 UI binding. I would like to add a save button which is disabled onload and is only enabled after a user modifies the data into one of the textboxes. I ...

using jquery .find() to get children

I have the following markup: <div id="items"> <div class="item"> <div class="item_box" id="id_1"> <div class="one" id="one"></div> </div> </div> <div class="item"> <div class="item_box" id="id_2"> <div class="one" id="two"></div> </div> </div> <div class="item"> <div class="item_bo...

js for validation date range

anyone can help me....how to validate javascript date for this problem: user select the start date and end date will be chosen to be more than 90 day from the start date.user can send form if end date below 90day... from date code : <input name="fromDate" type="text" id="fromDate" size="10" maxlength="10" onChange=""> <a href="#" name=...

Autofill a username and password

I would like to be able to click a link in Website A that will autofill a username and password into Website B. Can anybody provide me some ideas how to do this with JavaScript or PHP? Many thanks! ...

Getting class value.

I have an image, onclick on wich i make some ajax requests. i need to pass a variable from $_GET[] to my onclick function, so i deside to do the following <img id="img1" class="<?=$_GET['value']"?> /> and jquery $("#img1").click(function() { how can i get the class value here??? }); Thanks ...

how to get the image source in javascript?

I want to compare if the chosen image equal to the desired image.. Here's the initial code but is not working function mouseOut(txt){ var imgClick, imgOrig; imgClick = 'images/'+txt+'_onclick.png'; imgOrig ='images/'+txt+'.png'; if(document.getElementById(txt).src == imgClick){return false;} else {document.getElementById(txt).src = im...

iPhone browser/IIS/Tomcat, Japanese locale, http parameters getting messed

First the environment: the client is a mobile Safari on iPhone, the server consists of a Tomcat 5.5 fronted by IIS. I have a piece of javascript code that sends a single parameter to the server and gets back some response: var url = "/abc/ABCServlet"; var paramsString = "name=SomeName" xmlhttpobj = getXmlHttpObject(); //Browser specifi...

Gradient transparency of object in RaphaelJS

I'm trying to get a rectangle partly transparent where the left part is opaque while the right part is more transparent if you go into that direction. This works in Firefox, Chrome but not in Internet Explorer 7 or IE8. In IE all rectangles are displayed with the same transparent gradient. function drawTest(y, pct) { var recttest =...

Automatic refresh using jquery

Can anyone tell the jquery code for automatic refreshing of a page. ...

Link problem with Drupal 6.16

Hello everyone, i am currently working on a website and I need to make a chat application for it (as seen on some other questions i posted, haha) Anyway, the gist is that I now have my website (on localhost for the time being), and my chat application. Now i need to make a button which, on click, will open the chat webpage in a pop-up w...

HTML5 Canvas Question

I have a Sketching app done in all HTML5 and Javascript, and I was wondering how I would create an Undo Button, so you could undo the last thing you drew. Any idea? Thanks! ...

How to replace the hidden value dynmaicaly using java script in html

<form method="post" name="test" id="test"> <input type="hidden" name="listname" value="qpaustin" /> <select name="customCity" id="customCity" onchange="javascript:onChangeHiddenValue(this.value);"> <option value="qpneworleans" >qpneworleans</option> <option selected="selected" id="listSelectionActiveOption" value="qpnewyork" >qpnewyork<...

javascript not included in colorbox popup window

hi guys, I am using color box, its really fun, but i am really stucked out by a problem that: my form is opening in colorbox i am using jquery for validation in that form for which i am including validate.js in that page the problem is that i am not able to see the js file, when i open the page in window it is ok but when that page is o...

clearRect question in Canvas

I am looking to create an Eraser for a drawing app in Canvas, and I have this code canvas.clearRect(x, y, width, height); How would i implement it? ...