javascript

Nested iframe cross-domain communication

Here are two cases: Uppercase as one domain while lowercase as another 1.Suppose window A holds iframe b, and b holds iframe C, A & C in one domain(higher privacy) while b in another. Is there any direct way for communication between A & C, oneway or twoway. 2.Suppose A holds iframe b and iframe c, A is in one domain while B & C in other...

Mozilla Rhino: Default JavaScript Compliance Level

Hi there, to execute JavaScript in Rhino one has to create an execution context for the script. The constructor of the Context class uses the JavaScript compliance level VERSION_DEFAULT. protected Context(ContextFactory factory) { if(factory == null) { throw new IllegalArgumentException("factory == null"); } this.fa...

Javascript Date validation for Asp.net

if i want to validate date of in Text box like 11-jul-2009 using javascript as Per cluture then how can i do Pleas tell me if any body know that....? I am using this function.... function isDate(obj) { var retVal = false; var dteDate; /* Check for mm/dd/yyy format */ obj1 = obj.split("/"); obj1[0] = ...

Is there any advantage of AJAX/XHR over pure JSON/P implementations?

Not strictly a programming topic but input is appreciated. I've been developing a lot lately with YouTube APIs and I started with PHP code, using SimpleXML, then actually skipped AJAX and went straight to using native JSON and doing everything client-side. While it "feels" faster, I wonder if it's ready for primetime yet. Even with t...

Adding an html element using javascript makes other js wonky

Dear all: I have the following javascript code, which is modified from the SimpleUpload demo in SWFUpload. It's used to generate a temporary upload progress bar. It works fine, unless I add in the code which has been commented out. Basically, this line will break the presentation: this.fileProgressElement.appendChild(document.create...

IMEI using Javascript

Hi, is there any way to retrieve the IMEI number of a cellphone, using javascript? ...

Basic jQuery plugin for flash-based single file upload?

Hello, I'm looking for a simple jquery plugin to upload a file via flash. What I want: ability for the script to interpret an XML response from the server What I don't want: multiple file upload progress indicator and all the bells & whistles ...

prevent a default action with IE8

I have a script that on ONKEYDOWN event (e.g. Alt+f) it disables the default action that is to make browser to show its menu and make my custom action. In IE8 event.returnValue does not do the job. I have also viewed that if I do alert(event.returnValue) the value is 'undefined' ad it seems as that property there isn't in the object but...

how to use url and jquery

i wanted to know how do you get http://wesitename.com#overall How to make a div show when the link is #overall ? ...

Calling a JavaScript function onclick event of button when the function is define in a separate PHP file.

How do you call a JavaScript function from one PHP file that is defined in another PHP file? ...

WCF from JavaScript

I am having a WCF service Hosted separately in IIS I need it to consume from separate web application using JavaScript (client side) but my namespace is not recognized by JavaScript intellisense. When I browse my service it works fine. Is that any reference needed to be given to the .svc? ...

Handle Browser close in Javascript?

Hi Guys, Is there a way to trap the browser closing event from javacript. I don want to do this in Page Unload event or anything... it must be handled on clicking the browser close button.. is it possible?? Cheers Ramesh Vel ...

IE e.target.id is not working.

document.click = check; function check(e) { var obj = document.getElementById('calendar_widget'); if (obj != 'null') { if (e.target.id != 'show_calender') obj.style.display='none'; } } Error is in Internet Explorer: e.target.id is undefined. ...

Client side performace factors...??

Hi, I am workin in a application in which i need to maintain the last accessed UI state(like column filters, sortings, selected records, resized widgets, columns, etc) of the page throughout the app session, this only terminated on the session end(and ll be posted to db on the session end either by manual logout or browser close). i hav...

Help interpreting a javascript Regex

I have found the following expression which is intended to modify the id of a cloned html element e.g. change contactDetails[0] to contactDetails[1]: var nel = 1; var s = $(this).attr(attribute); s.replace(/([^\[]+)\[0\]/, "$1["+nel+"]"); $(this).attr(attribute, s); I am not terribly familiar with regex, but have tried to ...

JSON Data - Parsed Or 'Eval'ed

From a security perspective, I can see simply doing an 'eval' on incoming JSON data as a critical mistake. If you got data like below you'd have some problems. { someData:((function() { alert("i'm in ur code hackin' ur page"); })()) } I wondered what do most popular Javascript libraries do? Is it a manual parse or simply an eval...

js: Load html of a page from a different domain.

Hello guys, i was wondering how can i load the html code of a page, hosted on a different domain? I am using javascript, and want to create a bookmarklet that will enable me to parse the external html code. i have been googling for hourse in vain... thank you very much ...

Javascript: Difference between an object, and a hash?

In Javascript, what is the difference between an object and a hash? How do you create one vs the other, and why would you care? Is there a difference between the following code examples? var kid = { name: "juni", age: 1 } And: var kid = new Object(); kid.name = "juni"; kid.age = 1; And: var kid = new Object(); kid["name"] = "jun...

What is the PastryKit Framework?

I'm trying to find any information I can on the PastryKit Javascript Framework. It appears to be in use on the iPhone User Guide that is displayed on the iPhone itself in Mobile Safari, but I cannot find any documentation or API. If you want to see it in action, open Safari 4, set your user agent to iPhone 3 (In the Develop menu) and che...

Integrating js in build process

I'm wondering what the best way to minify and concatenate all my js scripts in one in a build process is. I've got the actual minifying working, but now need to set a reference in my html page to the minified file. In the dev version it has references to five files which get concatenated. Should I juts xmlpoke or something like that? Are...