JQuery or Ajax Script Help?

4th of February 2014 0

JQuery or Ajax Script Help?

I want something that when you click a link it changes the database fetch method from: mysql_query(“SELECT * FROM posts ORDER BY post_id DESC ;”);

mysql_query(“SELECT * FROM posts ORDER BY post_likes DESC ;”);

The page is allowed to reload, but nothing in the URL is allowed to change. You could make it change the value of a variable. Like on click it changes $ sort to post_likes instead of post_id.

I just need help, should be easy.

Best answer:

Answer by Neneng_Questionaire
You’ll need two webpages.
1. The ‘display’ page (can by static (.html) or dynamic (.asp, .aspx, .php), doesn’t matter)
2. The ‘transactional’ page (must be dynamic)

The display page will have a DIV or SPAN tag or whatever tag that has an “innerHtml” property.
It should look something like this:

display page

The display page serves as the user interface.

The transactional page on the other hand will be called by the display page.
It should look something like this:
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Net" %>

I hope this gave you an idea.
Good luck!

Add your own answer in the comments!

Filed under § jquery ajax — Tagged with , , ,

Share it!

Was it good for you to?


Support for the site!

No sponsors at the moment.

Your opinion matters. Add it below.

Tip: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent comments


Copyright jqueryui.info since 2010. All rights reserved. Design and the Absolute Theme by Tommie Hansen.