And then you style it however you want, its good for semantics that way, you would typically wrap it in a div and update that div with the output each time from your ajax.
It all works fine, and you can see an example here @ www.theshadownest.com.au click on the clock, and you will see the quote come up. disregard the other stuff in the box.
The idea i had for this was set up a large database of quotes with simple semantic output and let Ajax queries call that page, but i want to be able to call that page output from other servers, urls etc... I thought that would be fine, you just request the page with ajax on your site and it could return the response from my site...
How do you write a PHP/AJAX plugin that can work from multiple sites, because i want to be able to let anyone make a request, its basically a resource for people who want to add quotes to their site without setting up their own database or writing their own php.
In my php script (which is located at URL 'ships'), I am just getting the value of 'variable' from the $_GET super global but I obviously want that value to be dynamic and equal to the value selected in the dropdown.
I've been working on some prototype and scriptaculous stuff for a domain management DB at work. I have all the areas working I that I need them too, and I have the InPlaceEditor working.. but all I need to do is get the 'saving' to the DB to work.
My dilema is on the form, there are 7 form fields. I have it set to that when the user clicks out of the text box, I want it to update the DB right then and there. So for each updatable item, I have:
I set the options for the Cancel and Save button to be false and for it to update OnBlur. So the problem I run into is, I know how to update the DB with a full SQL statement, but to update them 1 at a time using this new AJAX features, I am running into some difficulties understanding the syntax for it.
I found this link at ONLamp.com and I think it's what I want to do, but not 100% positive.
My code for submitting currently submits to my database properly and I get a really simple xml response either <success type=Ɔ'/> (fail) or type=1 (success) My question is this, given that I receieve xml back why does my code run all 3 onXXX methods? I can understand it running onComplete but not both onFailure and onSuccess. What events/factors determines whether these triggers are run? Code:
What I have going on is an input box where they type in an account name. And the autocompleter works perfectly if they choose an item in the list.However, I want them to have the option of entering an account that is not in the list. And when they do this, the onblur event triggers the opening of the New Account box where they can fill out the new account information and submit the form back.Once again when a selection is made it works just fine, it's when the user creates a new account that it doesn't trigger the "getAccountInfo" function.
I'm writing this post as there are alot of questions about Cross Domain AJAX request so i'm going to give an overview of the different ways and the best practices Ok so there are 2 systems for this the key difference is how much control you have.
The first is tell the browser that the site the AJAX call is coming from is allowed this is done with
"Access-Control-Allow-Origin: " Now this can be set to a wild card and allow all sites to access the page
"Access-Control-Allow-Origin: *" Or you can say only a set server can "Access-Control-Allow-Origin: mydomain.com"
This header allows GET requests but what if you need to post data to the site well you need to tell the browser that POST data is allowed to be sent Access-Control-Allow-Headers: GET,POST
Now we run into the problem that sending post data the browser will send the header Content-Type but your server has not told the browser its allowed to send that header so Access-Control-Allow-Methods: Content-Type Will allow the header to be sent if you wish to send any other custom headers you have to make your server tell the browser its allowed to send them this is done by adding them as a comma delimited list via the "Access-Control-Allow-Headers" header
Now if you dont have control well then your back to using a script that is local to the AJAX script then sending the data via cURL or another connection method to the remote server
I'm looking to upgrade some of my scripts to AJAX (right now I'm sending info back and forth between an iframe), but wanted to make sure I wasn't losing some cross-browser compatibility by doing so. I saw this double checker on one of the tutorials and liked it, but I want to make sure it isn't limiting any other common (maybe even slightly older) browsers:
I know cross domain Ajax request are denied due to the security issues. As an alternative to this, I have heard of using JSON. I tried to use that, but I am unable to get it work. I had also tried the jQuery's $.getJSON() that didnot work as well.
Could you please provide me some working examples for this case?
I spent the best part of yesterday trying to get my form to be sent to the server however for the life of me I cannot figure out the problem. I haven't used prototype before but here is my code that I think should work perfectly fine,The php script works perfectly, i've entered test data into it and it makes a connection to the third party server using curl and then requests information that I get back i.e. the routing id comes back. But I cannot test the data using the form as the request isn't working for some reason.
I am recentlyexperiencinga problem with .ajax calling cross domain asp.net webservice. It started working fine, until the data returned from server is becoming too big and suddenly the ajax call caused errors, if i reduce the data length then the error went away. After doing some debug, i have identified the problem being the callback was inserted into the returned data.