Go Back   The UNIX and Linux Forums > Top Forums > Programming


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

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-11-2012
Registered User
 
Join Date: Aug 2012
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's Avatar
hergp hergp is offline Forum Advisor  
Problem Eliminator
 
Join Date: Jan 2010
Location: Vienna, Austria
Posts: 621
Thanks: 10
Thanked 124 Times in 115 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
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,371
Thanks: 490
Thanked 2,534 Times in 2,417 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 11:57 PM.