PHP Echoed in Ajax | Unix Linux Forums | Programming

  Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

PHP Echoed in Ajax

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-11-2012
AimyThomas AimyThomas is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 22 February 2013, 12:38 AM EST
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Echoed in Ajax

I have built a site in PHP for radio station, and the daily schedule is displayed dynamically using PHP script.

I have added links to view different days but when it loads up its just loading up a new page. I can't quite remember how I done it but I'd like it to be in ajax if that's possible.

I have no knowledge of what I need to do so any help to tutorials would be great.

Thanks in Advance
Sponsored Links
    #2  
Old 10-11-2012
hergp hergp is offline Forum Advisor  
Problem Eliminator
 
Join Date: Jan 2010
Last Activity: 26 July 2014, 3:41 PM EDT
Location: Vienna, Austria
Posts: 789
Thanks: 18
Thanked 167 Times in 149 Posts
Have a look at JQuery, it simplifies ajax a lot.

Here is a code snippet that shows, how to update a div in a document with a page fragment loaded with ajax


Code:
$.ajax ({
           type    : "get",
           url     : "/ajax/url/to/get/contents.html",
           context : "body",
           success : function(data)
                     {
                         $("#mydiv").html(data);
                         // do maybe some more tasks
                     }
       });

Sponsored Links
    #3  
Old 10-11-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 30 July 2014, 4:27 AM EDT
Location: Saskatchewan
Posts: 19,004
Thanks: 752
Thanked 3,154 Times in 2,959 Posts
Quote:
Originally Posted by AimyThomas View Post
I have added links to view different days but when it loads up its just loading up a new page. I can't quite remember how I done it but I'd like it to be in ajax if that's possible.
AJAX also loads pages -- it has to get the data somehow. It just does so in javascript with an xmlquery..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
execution of a string being echoed in bash ida1215 Shell Programming and Scripting 1 12-15-2011 01:08 PM
Putting echoed text into a new file likelylad UNIX for Dummies Questions & Answers 7 01-27-2009 05:55 PM
echoed prompt not appearing until after read command. simonb Shell Programming and Scripting 2 03-19-2006 10:15 AM



All times are GMT -4. The time now is 07:06 AM.