Results 1 to 6 of 6

Thread: AJAX Help

  1. #1
    Join Date
    Apr 2011

    AJAX Help

    Need some direction for some AJAX. Basically trying to add a favorite button but instead of loading the called script it loads the whole page into the placeholder. I don't fully understand the code some it's a very tediuos trial and error hoping I stumble upon a solution

  2. #2
    Join Date
    Mar 2010
    Upstate New York
    How familiar are you with AJAX? If you're just starting out, I suggest Google of phrase AJAX examples or AJAX tutorials. It boils down to calling a script, then reading in the results and manipulating them on your end. Once you see several examples you'll see how it works.
    John Rasri
    Private Label Live Chat Provider For Resellers
    White Label/Brand-able live chat software solutions

  3. #3
    Join Date
    Apr 2011
    Thanks, I've had some success. My issue was I had an index file that controlled the site. Basically grabbed the url, broke it into an array and then that data was used accordingly, sort of a basic MVC model. For some reason the ajax call was passing through the index file and re loading the home page and due to the directory structure making a mess of t he parameters. I've now changed to a htaccess structure and it seems to work fine.

  4. #4
    If you aren't aware already, using JQuery rather than built in AJAX functions is recommended, it's one of those "it just works" things. Also the tutorials for AJAX through JQuery are very clear.

  5. #5
    Join Date
    Apr 2011
    Thanks. Managed to get the Ajax working but major drama. For some reason the page that was being called on had to have new connections to the database and had issues passing variables into it.... For a simple feature a huge hassle.

    I plan to look into the jquery approach just unclear on the success: fail: side of things. how to pass this back from the script to the jquery call. Can you or anyone point e in the direction of some good tutorials?

  6. #6
    You don't need to learn lol
    there is a funtion you can use than edit it that's all

    Example :

    function ajax () {
    function changeEtat () {
    if (xhr.readyState==4) {
    var texte=xhr.responseText;
    document.getElementById('cc').innerHTML=texte;}else document.getElementById('cc').innerHTML="<br><center><img src='images/load.gif'><center>";
    var xhr=new XMLHttpRequest();

Similar Threads

  1. Replies: 1
    Last Post: 07-04-2010, 08:16 AM
  2. Replies: 0
    Last Post: 06-26-2009, 08:26 PM
  3. Ajax?
    By SaniX11 in forum Programming Discussion
    Replies: 2
    Last Post: 08-13-2006, 06:31 AM
  4. Ajax
    By EfreeZe in forum Programming Discussion
    Replies: 2
    Last Post: 04-01-2006, 05:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts