jquery-ajax

Element.text is not a function

I know this has been asked plenty of times before and I already went through a bunch of posts as well as googled for the answer but I just can't figure it out... here's my php $connect = mysql_connect("localhost", $usuario, $password) or die(mysql_error()); $select_db = mysql_select_db($dbname) or die(mysql_error()); //query the data...

Jquery - iterate through all xml tags

how to loop over all tags in a xml i have a php that generates xmls like the next one <register> <name>peter</name> <age>12</age> </register> <register> <name>mary</name> <age>20</age> </register> so i receive this xml (this works fine) $.ajax({success: function(xml) { $(xml).find('register').each (function() { ...

jQuery - Ajax sucess parameter as object function

jQuery - ajax success parameter i wanna know how to give a object method (function), on the success parameter, to the ajax function (sorry for my english) lets say i already set my ajax.setup with all i need to call a php on the server. function myClass(id) { this.id = id; this.showValues=function(xml) { alert(this.id); // ...

jQuery: I get OPTIONS request instead of GET

I am using simple jQuery $.get( .... ); Here instead of getting GET response I get OPTIONS.( checked in firebug Net) Same code is working fine in Safari. Looks like some problem with Firefox. Any workaround / solutions to fix this problem.. Thanks Kurund ...

How to retain context across an Ajax call

I need to make an Ajax call and have the response update a child of the DOM element that was clicked to trigger the event. Sample HTML: <div class="divClass"> <p class="pClass1">1</p> <p class="pClass2">Some text.</p> </div> <div class="divClass"> <p class="pClass1">2</p> <p class="pClass2">Some text.</p> </div> <div class="divC...

json response from the server (how to populate the response from server in selectbox)

Hi all, I am trying to populate a select box (cities related to a state) using the $.ajax method of jquery. I wrote the following in my php script $('#cmbState').change(function(){ $('#cmbCity').children().remove(); $.ajax({ type: "POST", url: "../include/ajax.php", data: "option=getCitiesList&stateid="+$(this).val()+...

jQuery + MySQL Noob Problems

I'm trying to get this to work, but no luck. It's 3am, so that may be the problem. What am I missing here? I'm trying to insert some data via jQuery to a local MySQL table. If I run save.php on its own, it inserts a blank row in the DB, so that works. Any ideas? **index.php** <html> <head> <link rel="stylesheet" type="text/css" hre...

Jquery Ajax $.getScript() method

Hi Everyone... $.getScript of Jquery's ajax methods can be used to load and execute javascript from remote location... Can it also be used to just load the javascript and execute it later when some event occurs on elements that have been loaded using ajax based on some user action...? Thanks and Regards.... ...

jquery .text doesn't render HTML elements into the DOM

Hi I am loading a list of images into a div with the following bit of jQuery : var jewellerDdl = "<%= JewellerDropDownList.ClientID %>"; var filter = $("#" + jewellerDdl).val(); $.ajax({ type: "POST", url: "popup.aspx/GetJewellerAssets", ...

XML cannot be the whole program

I am using jquery to make an $.ajax() call to a REST web service. Based on the documentation I found, I need to use jsonp as the datatype in order to make this cross domain call (an XML document is what is actually returned). When running my code, however, I receive the error "XML cannot be the whole program". Does anyone know what this...

jQuery can't catch div

I get dynamic content with Ajax and i put it in a div, but the problem is that i have diffrent ids for some child divs(from the dynamic content). So i have added selectors for these divs, but as i said they are dynamic loaded and that means they are not visible anywhere before they are loaded(from another file) and inserted into the div....

Escape character and error 500

Hello everybody. I have a problem with some basic ajax and asp.net web service. In my website page i have a text box that is reach text editor, when i put text and try to submit it, ajax supposed to take the text and pass it to asp.net web service. When the sentence contains no escape characters it goes well, however when it does contai...

high load on mysql DB how to avoid?

I have a table contain the city around the worlds it contain more than 70,000 cities. and also have auto suggest input in my home page - which used intensively in my home page-, that make a sql query (like search) for each input in the input (after the second letter).. so i afraid from that heavily load,,...,, so I looking for any sol...

Returning an array from a PHP function to jQuery

I have a PHP function that returns an array. What is the best way to "receive" this using jQuery? ...

how to sharethe web application session with a webservice

Hello, Here's the scenario. My page loads with certain objects in the session. The user clicks a button, and I need to update a certain section of my page using jquery. The jquery would make an ajax call to the web service which needs to access one of the objects in the session. How would I do this? How can my web service access the ...

Problem with getting page with JQuery?

Hi I have a two aspx file, one of them Default.aspx and other is Insert.aspx . Insert.aspx expects two parameter named firstname and lastname, and saved these values to the database,and writes a welcome message like 'Welcome John Stinger'. Default.aspx contains a simple form , two textbox and one button (txtFname, txtLname,btnInsert) a...

Strange jquery post problem, wrong post url is used

I have a form I wish to submit via ajax usind the jQuery $.post command. The form looks like this: <form action="/wine/merlot/reviews" class="new_review" id="new_review" method="post"> And the jquery call is: $(document).ready(function() { $('#new_review').submit(function() { $.post($(this).attr('action'), $(this).serialize(),...

How do you validate a page with AJAX content with a W3C service or similar.

I have a web page that is the parent to a bunch of pages that are loaded with in using the following code. function loadContent(elementSelector, sourceURL) { $(""+elementSelector+"").load("http://url.com/"+sourceURL+""); } To call this I would have a href like href="javascript:loadContent('#content','page.php')" How can you val...

beforeSend in $.getJSON

How do I use beforeSend callback in $.getJSON(cross domain). More specifically $.getJSON is call is to a YQL service Like select * from html where url=”http://www.yahoo.com” ...

X-HTTP-Method-Override in jQuery?

How can I do an X-HTTP-Method-Override for an ajax request in jQuery? ...