ajax

how to fill up numbers in a form field via a popup key pad(using Javascript/AJAX)

I have a small project, wherein I need to develop a keypad with all the digits+backspace+decimal (all as buttons). These digits when clicked should populate a form field (say a text box). This keypad should be located next to the form field as a link. The keypad should be preferably Javascript/AJAX. Also the keypad routine should have a...

catch variable in ajax success function to stop submit form

Hello, I have a problem within this code. I want to choose whether I will submit the form or not based on the outcome off the ajaxcall. If I hardcode it with return false; It stops going to the paypal site. That's why I want it to depend on a variable set in the ajax succes function. It is probably lost in the callback, so that's wh...

AJAX - load all div elements

I have a webpage with a number of div elements such as this one: <div id='ahFyb2JpdGFpbGxlc2FuZGJveHIKCxIA'> </div> I would like each div element to call a javascript function when it has loaded, to fill in the div. Ideally I would have liked to do <div id='ahFyb2JpdGFpbGxlc2FuZGJveHIKCxIA' onload=getcontent('ahFyb2JpdGFpbGxlc2...

How to get formcollection using ajax.actionlink

I have a controller with the codes like this: [AcceptVerbs("POST")] public ActionResult Create(FormCollection collection) { //why is that the collection is null? } I am calling this action using the ajax.actionlink. my problem is the collection is null, unlike if i use the submit(input) button the formcollection has values. ...

ajax call fails to return true or false to the submit event

Hello, I will just come right to it. I need to know how I can return false or true to a submitbutton. I read some other post here, that says it cannot be done from within a ajax success function because it wil return to the ajax context and not the submit event. Maybe someone has a workaround for this?? also in the context that I am...

Load content into parent element with jquery

I have a div element with a specific ID <div id='someid'> <input type='submit' class='edit' value='Edit'> </div> When the button is pressed, I want to select the parent element (in this case the div element) and load content into it. I've tried: $(document).ready(function(){ $(".edit").click(function(){ var id = $(this).par...

Update DOM after insert in jQuery

Let's say I use jQuery to load new content into a specific DIV element. If I now want to catch events from inside that DIV element, I assume the DOM has to be updated somehow? What is the best way to deal with this? Edit: Here is an example of what I mean: <html> <head> <script type="text/javascript" src="jquery-1.3.2.min.js"></s...

IE6 AJAX Response Data Issue

I've been looking all over and i can't find anything to fix this problem. IE6 only is having an issue with the response of an AJAX call and is erroring because of invalid data (alerting the data shows a single beauitful weird square) Locally IE6 works perfectly (same page and same data), i've checked and rechecked its calling the corre...

Edit parsed JSON

I have a JSON file contact.txt that has been parsed into an object called JSONObj that is structured like this: [ { "firstName": "John", "lastName": "Smith", "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumbers": [ { "type": "home", "...

jQuery $.post update not working in IE...

I can't get this update script to work in IE. Works fine in every other browser. IE tells me that the update was performed. However, it wasn't. I've no more hair left to pull out..grr. BTW I've tried $.ajax and $.get too..still no luck. I'm thinking it may have something to do with the live click handler. Don't know...I've tried eve...

display image preview

i want to display image after it upload i write following code but it did't work onFileSuccess: function(file, response) { var json = new Hash(JSON.decode(response, true) || {}); if (json.get('status') == '1') { file.element.addClass('file-success'); } else { file.element.addClass('file-failed'); } }) and li is ...

Problem with ajax/jquery and django

I want to send a value to the server.I send it using: $.post("http://127.0.0.1:8000/search/",{'long':"30"}); and my views.py is: def search(request): lon = request.POST.get('long','') place = Places.objects.filter(longtitude__icontains=lon) if place is not None: return render_to_response('sr.html', {'place...

javascript dialog over a flash movie

Hello I have a such system: When the mainsite opens, A flash image gallery appears, when the user clicks on an image, using the Flash's "ExternalInterface.call" function, I call a javascript function that opens a java dialog modal named nyromodal (which fetches raw HTML data via ajax from another page inside the dialog box) on the flash ...

create style class in javascript

i want to crate style class in java script tags and class will be like this #file-ok { background-image: url(+ json.get('filename') +); } actually json.get('filename') will be name of file for background and will return from php file. is this possible...? ...

Send data to server

I am developing an app for the iphone.The thing is that i want to send the values of longitude and latitude i get from the phone using javascript to a server commanding it to search for something.Do i have to read about cross domain stuff?How could this be done? I know that i can use Ajax but it can serve me if i refer to the same domain...

understanding jquery event binding

Hi guys, I have a div on my page where I would like to display comments stored in a database. now what i want to understand is how the jquery live() function works. if I bind a click to an element say the div, then do I have to click? I just want the comments to be drawn and shown when the page loads or reloads. ...

jQuery/Ajax/javascript in FireFox Error when using $.post/$.get

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost/scripts/jQuery.js :: anonymous :: line 808" data: no] Line 0 is the error i get when i bring up firebug. This only happens in firefox (and maybe other br...

mootool display image

i want to display image after it upload using mootools i write following code but it did't work onFileSuccess: function(file, response) { var json = new Hash(JSON.decode(response, true) || {}); if (json.get('status') == '1') { file.element.addClass('file-success'); } else { ...

differences iphone safari webkit vs mac safari

hi there, i'm trying to create a website for iphones with the apple typical sliding menue effect. on safari and firefox on my mac everything works pretty fine, but checking the page on my iphone safari made me wondering. there's the link to the slider test... IphoneSliderTest it would be nice if you could check the page on your iph...

Javascript if(function_foo()) doesn't wait for function_foo() to complete

I have an if statement: if(authenticate_session("secret_password12345")){ alert("You are authenticated"); }else{ alert("Intruder alert!"); } and the javascript authenticate function, which makes an jQuery POST AJAX call to the server to do the actual authentication, and returns true or false: function authenticate_session(sess...