javascript

overriding default property in an object

i want to make an ajax call to a php file that return a users info in json then take that data and put it in an object property example: System = { prop1= '' } i just want to override the prop1 property im using jquery to make the ajax call ...

If user = XXX visitor, prompt for email...?

I'm trying to code a site where every 10,000th visitor is prompted to enter an email which can be stored in a text file. I have a hit counter set up where it outputs the total visitors to a text file, so is it possible to set up a script to something like "If number =*(10,000) from visitor.txt then prompt for email save to =emails.txt...

How can i call the parent-window jquery function with variable from popup window javascript?

any simple examples i want ? thanks in advance. ...

compare string inside windows.alert

Hi all: This might be a dumb question, but considering the following semi-pseudo code. How do I compare the string in windws.alert? var alertCalled = false; // I'm having trouble with the following line if (windows.alert().text == 'specific string') { alertCalled = true; } Thanks. ...

JavaScript Regular Expressions - Forcing case when replacing

Does the JavaScript regex standard support forcing case when doing a search/replace? I am generally aware of the \u etc. options for forcing the case of a capture group in the replacement portion of a regular expression. I am unable to figure out how to do this in a JavaScript regex though. I do not have access to the JavaScript code ...

Lightbox/Forms Question...

I am trying to allow for the filling out of a form from a lightbox pop up window. One like the one that Get satisfaction uses (though I only need to be able to collect info, not display from a query as well). You can see a Get Satisfaction example at http://tweet.fabeetle.com and clicking the feedback tab. What is the best way to do th...

dojo mouseover with delay

I wish to do something like as follows: When the mouse goes over to some element, record it If the mouse stays there for 3 seconds, then execute some action f() for that element If the mouse leaves that element before 3 seconds, then the action should not be executed. How can I implement this delayed execution with possible cancella...

javascript textarea: what was typed/pasted, and where?

How do you find out what the user typed or pasted into a textarea? For example, if they typed in B (or β) at index 1, or if they pasted hello world\n at index 23. I've searched a fair bit but can't find anything. Here's what I have so far, uses jQuery: $("textarea").keydown(function(evt){ var index= getCaret(this); // this.selection...

how to find out "parent window reload completion", from popup window?

I have to call jquery in the parent window after reload completes,so i need this ans...thanks. ...

what is replacement for $addhandler and $clearHandlers

Hi! what is replacement for $addhandler and $clearHandlers? I do not want to use Microsoft Ajax. just want to user document methods. ...

How to take a snap of DOM and reconstructure via that snap?

So this is 2 questions? What I'm gonna do is this: User can modify the elements on the page,and after modifying he can save the changes,and next time when he opens the page,it's like when he saved it. It's a little similar to http://www.google.com/ig,which saves your change when placing the widgets. And I've found it'll se...

make asp.net server control cross browser compatible.

How can i make asp.net control cross browser compatible? it is compatible with IE only. Let me know the best steps to do this. ...

Javascript: How to remove an array item(JSON object) based on the item property value?

like this: var arr = [ { name: "robin", age: 19 }, { name: "tom", age: 29 }, { name: "test", age: 39 } ]; I want to remove array item like this(an array prototype method): arr.remove("name", "test"); // remove by name arr.remove("age", "29"); // remove by age currently, I ...

get web page text via javascript

Is there a JavaScript statement that will retrieve the contents/text from a web page? ...

How should i start to learn javascript/jquery etc.? My programming knowledge is zero?

I'm from design background. My programming knowledge is zero. After learning xhtml and css i want to learn and get good command on Javascript/jquery etc. How should i start? This will be my first attempt to programming. I can use and edit readymade available jquery/javascript scripts but can't make my own and can't do high level editing...

Will (variable or {}) work crossbrowser in Javascript?

The if(variable) clause in the following constructs checks if list/array is not null/undefined, to avoid an exception: if (list) for (var k in list) { ... if (array) for (var i = array.length; i >= 0; i--) { ... But JS syntax allows expressions like null || [] undefined || {} So I can make code shorter by on...

How do we find the width of scroll bar?

Do you know any cross-browser methods? ...

The DOM, Jquery and Accordions

Hello, I have a page the makes an AJAX request, and returns some data from the database, once it is retruned I am trying to append it to a div and make an accordion, however all I am getting is the data back and no accordion here is my source code once the AJAX has run.(snippet) <script type="text/javascript"> $(document).ready(f...

Open source software which allows user to draw ER/flow diagrams for my web application

we are developing a web application which allows a user to draw diagrams(flow/ER diagrams) and we need the representation of that diagram in some XML or other formats. How should we acheive this ?? is there any open source software or jQuery plugin or anyother server side software?? ...

Retrieve the source of a dynamic website using python (bypassing onclick)

I wish to retrieve the source of a website, that is dynamically generated upon clicking a link. The link itself is as below: <a onclick="function(); return false" href="#">Link</a> This stops me from directly querying for a URL that would allow me to get the dynamically generated website (urllib/2). How would one retrieve the source...