javascript

The right way to get http referrer from jquery

Command $(document).referrer is the correct way to get referrer with Jquery? ...

how to make an ajax request after sending data by post?

i meet a problem, when try to make an ajax request after sending data by post. let's assume i have a index.php file. In the form i send data by post to the same file, and after posting i want to make ajax request, but it don't doesn't happen, because it "wants" to ask about resending data, but it doesn't show in popup window. So, how ...

Replace all "\n" with ","

I have a textarea and I want to replace "\n" with "," in it's value. var valuetxtarr = $("#txtarr").val(); var valuetxtarrs = valuetxtarr.replace("/\n/g",","); alert(valuetxtarrs); But it don't work?Why?Where I have mistake? ...

function(e){e.something...} who is e?

just now i ask a question, and it creates a new question. for example, when i wrote $("#new_lang").click(function(e) { alert("something"); e.stopPropagation(); }); who is e here, and why it doesn't work without it? why can i write anything instead of e? Thansk ...

IE issue dealing with "unsecure content" - Javascript BUG

Hi there everyone, I've got a problem with a web application, a rich internet application in fact, in which every component resides on a secure https connection. Common content are: html files, images, js files and the like, all are on and retrieved from https connections. A single part of the application (when a tab action gets execu...

Using MS Ajax Minfier 4.0 for Asp.Net MVC 2.0?

I am planning to use MS Ajax Minifier with Asp.Net MVC 2.0 for handling the Js and Css files. Does anyone has experience with MS Ajax Minifier? I have following questions regarding this. Is it the best way to use JS/CSS files in Asp.Net MVC or is there a better way. E.g. YUI Compressor, Telerik Extension for MVC? As I understand we ca...

Javascript Versions ?

Please tell me about difference in ........ javascript javascript1.1 javascript1.2 javascript1.3 javascript1.4 javascript1.5 javascript1.6 javascript1.7 ...

javascript not working in chrome/opera/IE but firefox is excellent!

I've got this code, working only in firefox. <script type="text/javascript"> function setVideo(url){ url = url.replace("watch?v=","v/","i"); var movie = document.getElementById('movie'); movie.setAttribute('src',url+"&hl=en&fs=1&"); var param = document.getElementById('paramm'); param.setAttr...

prevent browser from generating double click event

I have two overlapping div elements in my web app. On the underlying div an event is registered on double click. On the div that lies above the other div a event is registered on click that hides the div. The problem is that if I double click on the above div element it is hidden after the first click BUT the second click causes the d...

How to open new popup window from liferay portal using jsp ?

How to open new popup window from portal using java script. I have jsp page with button , if i click the button need to open new popup window from portal. onClick="window.open('/html/viewpdf.jsp','mywindow','width=500,height=350,toolbar=no,resizable=yes')"> this doesn't working jsp page. ...

Javascript method not defined

Why does this not work when I move the code in the first script block (without the script tag itself) to an external javascript file. The idea is to call homead.load() from home page and load everything processed by homead_build(); Error says 'homead not defined' using Firefox Error console <div id="box"> </div> <script type="text/j...

How to communicate between two NativeWindows in Air

How can I send messages to or manipulate the contents of a NativeWindow instance from the parent window that created it? I have read several places that to communicate between NativeWindow instances in the same application you need to "maintain a LocalConnection or write a whole whack of JavaScript". As it happens, I have no issue with...

Can this be done in Javascript or DHTML? (From Flash)

Please check this link: http://www.kings-mall.co.uk/index.php?id=5 Check the mall layout, it's done in flash. I was wondering if this can be done in Javascript or DHTML? But the list at the bottom would be links instead. When the mouse hover at one position/category like 'Fashion and Sports' it would highlight a lot of links and its po...

Difference between single quotes and double quotes in Javascript

I know that in PHP the only difference between double quotes and single quotes is the interpretation of variable inside a string. Well, in jQuery Javascript, I often see doublequotes used in jQuery selectors, or in strings, is there a particular reason for that or is single quotes just the exact same as doublequotes? ...

capturing key press event in DIV

i need key press or key down event for DIV, when the DIV has the focus? any ideas ...

Google/YouTube Insight style "Interactive PNGs"?

I have been looking at the YouTube Insight function and want to learn how their chart PNGs are created. If you have a video and look at the statistics, you get a bunch of PNG-images that in many ways can be considered interactive. Look at the image below. As far as I can tell, everything consist of PNG images. I expected to see flash...

Having trouble animating SVG rect's opacity using Raphael.

Hi, I'm using the Raphael library and trying to animate the opacity of a rectangle from 0 to 1. Here's the code I've written: this.myRect.attr( 'opacity', 0); this.myRect.animate({opacity: 1}, 1000); This does not work, and I believe it's the animation line which is incorrect as I can set the initial attribute to a lower val...

Javascript Date Regex eg. 2010-06-03

i want a function that validates dates of the format in the title. what is wrong with my function? function validateDate(date) { var pattern = new RegExp("^\d{4}-\d{2}-\d{2}$"); if (pattern.test(date)) return true; return false; } thanks! ...

Space between two words are getting lost after assigning php variable to javascript variable

Hi All, I have created two simple files in php. first file (i.e. input.php ): Created one form having one textbox and one submit button I have one textbox, user will add input in this textbox One submit button, after clicking on this form will get submit ( used post method ) Second file (process.php) : Posted contents are receive...

Javascript does not recognise dynamic div content

I have a script i have been battling with now for like a week. I have a page which has a div with id ("content"). Now I loaded some content, a form contained in a div tag to be specific, into this div VIA Ajax, and it is displaying fine Now, the challenge is - When the form is submitted, Im am calling a function that will disable all t...