Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:11:19+00:00 2026-05-28T06:11:19+00:00

acctually i am not familier much with jquery.. i got this jquery script this

  • 0

acctually i am not familier much with jquery.. i got this jquery script this is passing variables to the file which is showing data in json format.. but here i’m unable to show that data..plz see this piece of code

$(document).ready(function() {
    var globalRequest = 0;
    $('#search').bind('keyup', function(event) {
        if (event.keyCode == 13) {
            searchAction();
        }
    });

    $('#search-link').bind('click', function(event) {
        searchAction();
    });

    var searchAction = function() {
        var value = $('#search').val();
        var cat = $('#category').val();
        var country = $('#country').val();
        var page = $('#page').val();

        var resultContainer = $('#results');

        if (value.length < 3 && globalRequest == 1) {
            return;
        }

        _gaq.push(['_trackEvent', 'Search', 'Execute', 'Page Search', value]);

        globalRequest = 1;

        $.ajax({
              url: "search.php",
              dataType: 'json',
              type: 'GET',
              data: "q="+value+"&category="+cat+"&country="+country+"&page="+page,
              success: function(data){
                globalRequest = 0;
                resultContainer.fadeOut('fast', function() {
                    resultContainer.html('');
                    console.log(data.length);

                    for (var x in data) {

                        if (!data[x].price)
                            data[x].price = 'kA';

                        if (!data[x].img)
                            data[x].img = 'assets/images/no.gif';

                        var html = '<div class="res-container">';
                        html += '<h2><a href="'+data[x].url+'" target="_blank">'+data[x].Title+'</a></h2>';
                        html += '<img src="'+data[x].img+'">';
                        html += '<h3>Price: '+data[x].price+'</h3>';
                        html += '</div>';

                        resultContainer.append(html);
                    }

                    resultContainer.fadeIn('fast');
                });

              }
            });
    };
});

in search.php data is in simple echo.. how to get data from search.php and show here..
sorry for bad english

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:11:20+00:00Added an answer on May 28, 2026 at 6:11 am

    First,

    you shouldn’t concatenate your parameters but use a hashmap:

            $.ajax({
              url: "search.php",
              dataType: 'json',
              type: 'GET',
              data: {
              q : value,
              category : cat,
              country : country,
              page : page }
    

    As your method is (type: ‘GET’), just use the ($_GET[param] method) in the php file

    <?php
    $value = htmlentities($_GET['q']);
    $category = htmlentities($_GET['category ']);
    $country = htmlentities($_GET['country ']);
    

    In the js callback function, this is how you log the whole response (‘something’ is a tag) :

    success: function(data){
        var $xml = $(data);
        console.log($xml); // show the whole response
        console.log($xml.find('something')); // show a part of the response : <something>value</something>
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, this code does not actually draw my bitmap file... or show
I'm working on a project that is using jQuery, which I'm much more familiar
Disclaimer: This is not actually a programming question, but I feel the audience on
Is it correct to assume that JQuery is not actually an implementation of ECMA
This deals with WordPress plugin development. Even if a user has not actually signed
actually this is not hang status, i mean..it slow response, so in that case,
I want to have only review from this JSON. var json = { provider:
I'm using std::make_pair() for this example because pretty much any C++ programmer ought to
I've got a project in which I'm trying to do some refactoring of my
I read that Python does not actually support 2D arrays but rather an array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.