javascript

How to reload http window.opener from https popup?

I have an http window which opens a secure popup to submit a form to a third party web site. After the popup is closed, I would like to reload the opener so that it reflects the results of the form submission. Since the opener and the popup use different protocols (http and https), I can't do it in the straightforward way (window.opener...

How do I make an XHRDataSource request to a Django server in YUI?

I'm using post, and the YUI documentation example code isn't working. YAHOO.util.Event.addListener(window,"load",function() { var columnDefs = [ {key:"url", sortable:true, resizeable:true}, {key:"title", sortable:true, resizeable:true}, {key:"count", sortable:true, resizeable:true} ]; this....

Difference between a class and an object in Javascript

What's the difference between var myView = function () { //something goes here }; and var myView = function () { //something goes here return { a: x, b: y }(); I think the first snippet creates a "dynamic" class, so that you can say var anotherView = new myView(); and the second snippet is similar to a sing...

Android's Webview cannot handle javascript??

My android application displays webpages(i used webview for it). .but javascript onthe wepage is not running in a webview .If i visit the same webpage through the Browser,javascript is running . How to run javascript in an application(using a webview)? ...

Browser history via JS or CSS

For many years now, it has been known that a website can use CSS/JS to determine websites that have been visited by a user, e.g. http://news.softpedia.com/news/Mozilla-to-Fix-8-Year-Old-Browser-History-Leak-Issue-139015.shtml http://yro.slashdot.org/story/09/07/02/1317205/Your-Browser-History-Is-Showing There are sites that will use th...

background-size lags JavaScript?

I have a div with the background-size: 25%... I have some JavaScript that does a dropdown box. Without the div, the transition is smooth, however with the div present, the dropdown box is very choppy. Its only choppy when the background-size is set to 25%... Is there a way to fix it so it isn't laggy? ...

Is there a javascript parser like date.js for time estimates?

I'm working on a project where the user needs to provide time estimates on specific tasks. Im wondering if there's a script already out there ( like date.js ) that can take user input and parse it to number of seconds. Examples: "2 days" = 172800 "2 hours" = 7200 "1d 5h" = 104400 "15 minutes" = 900 date.js is great for finding the s...

How do I collect information about my website's visitors?

Is there some way to store: A visitor's IP Address What time a visitor visited my site How many times they visited I know there is a way to do this without PHP, just with Javascript and some text files. Edit 1: How it would I do this in PHP? ...

Prompt User to Fill in Form Prior to Leaving Web Page - via Javascript

I have a web form on my web page. Before the user leaves the page, I want a javascript popup message asking the user if they have completed the form with a "Yes" or "No" button on it. If the user clicks "Yes", then they are brought to the page they intended to go to. However, if the user clicks "No", then the user remains on this page. ...

difference between \r and \n

what is the difference between \r and \n in regular expression. can some one explain me with an example ? ...

What do the comment characters in MDC's forEach do?

JavaScript in modern browsers includes the Array.forEach method that lets you write this: [1,2,3].foreach(function(num){ alert(num); }); // alerts 1, then 2, then 3 For browsers that don't have Array.forEach on the Array prototype, MDC provides an implementation that does the same thing: if (!Array.prototype.forEach) { Array.protot...

How to extract the webkit transformation syntax in Javascript

Hi all! I would like to extract the individual elements of a composite webkit transformation in Javascript. For example: var act_transform = element.style.webkitTransform gives me: scale(0.6) translate(0px, 2236px) rotate(12deg) What is good human readable, but terrible to parse programmatically. I'm interested on all 4 numerical ...

DWR Exception Handling

I'm trying to capture and handle the return of a NullPointerException in my DWR method call: CompaniesByCountyFactory.getElementCompanies(command, countyId, stateId, { callback:popupDisplay, errorHandler:function(message){jQuery("<span>errorHandler::"+message+"</span>").dialog();}, exceptionHandler:function(errorString, exception){jQuer...

Stack Input fields on top of eachother

I have two input fields (a textbox and select) that I would like to get stacked on top of eachother. In my js, I will check the value of something and set on the of the elements style to hidden. When I use the following code, the select and textbox are both completely visible (this is before I mark one as hidden). Is there a CSS property...

Javascript debugging Visual studio 2008

It is supposed to be one of the great feature of VS 2008, javascript debugging. But so far, I couldn't make it work. The only way is by using the "debugger" keyword (which don't really work for me but that's another story). Do you have any clue on why it's not working ? I unchecked the "Disable script debugging..." in the IE8 options but...

Error trying to use getElementsByName in order to choose multiple "placeholders" (JavaScript)

This script of mine has a function, which is not working the way, I want it to. Take a look at the script, the function is called display_Value(): <html> <head> <title>JavaScript</title> <!--Scripts--> <script type="text/javascript"> <!-- function noValue(id) { var _value = document.getElement...

Ideal value for <a href="?"> when used for a JS event?

I've got a link I want to appear on my page, <a>add another</a> But it doesn't look like a link unless I add an href attribute. I'm going to be using jquery to add a .click() event to it, so it doesn't really need anything else. What's the best value to href to? #? javascript:void(0)? My concern is if someone clicks it before the .c...

.change() would not work in IE for <select> tags

I have such a combo box in my site and I want it to load some content as soon as it's changed by the user. It's a simple one having each State of my country, check it out: http://jsfiddle.net/tzvyX/ It happens that in IE, the .change() method doesn't work and I don't know what to do to fix it. maybe some other event listener? ...

firefox making white "flash" as it builds the page.

Ive been working on building a website with a flash slideshow component, and I am a little bit puzzled. When I view the page in Firefox (3.6.8), it appears to download the content of the page first and makes a white "flash" as it downloads the slideshow. But when I view the page in Safari it appears to build the page first, then downlo...

Accessing script block with jquery

I have a script block, in the div element which is appended after html response. I want to access this block and call eval() function for this script. How can I access the script block. I tried $("#divId script") , but it doesn't work. <div id="divId"> <script type="text/javascript"> .... .... </script> </div> ...