Tag Archives: jquery

hide jquery elements in an ajax function

Questions: I am trying to submit a form using jquery and the $.ajax () method. When submitting the information to the server I want only the result to remain and the rest of the page to be hidden. Am I able to add a conditional in the ajax method that states ” if(success) then display… Read More »

Jquery autocomplete and PHP: populating input field with data from mySQL database based on selected option in autocomplete field

Questions: I am trying to populate a Postcode (ie zipcode) input field with data from a mySQL database, based on the user’s selected option of Suburbs from a jQuery autocomplete field. The autocomplete works fine – the filtered Suburbs list is retrieved based on the input terms from the user. The source reference is a… Read More »

jquery select2: error in getting data from php-mysql

Questions: I am testing select2 plugin in my local machine. But for some reason. it is not collecting the data from database. I tried multiple times but not able to find the issue. Below are the code . <div class=”form-group”> <div class=”col-sm-6″> <input type=”hidden” id=”tags” style=”width: 300px”/> </div> </div> <script type=”text/javascript”> var lastResults = [];… Read More »

How to use jQuery AJAX for an outside domain?

Questions: I am trying to perform a simple jQuery AJAX attempt using either a .get() or a .post(). If I have a local copy on my server and do: $.get(‘/hash.php’,…,…) I monitor in my console in firebug that the get is done and I get a response. All I change is the URI to an… Read More »

jQuery Ajax on Different Port

Questions: My php file located at port 80 (default port) while my ajax call are on port 8080. My index.html on port 8080 $(document).ready(function(){ $.get(“userCheck.php”, {“username” : “lazy”, “favcolor” : “FFFFFF” }, function(data){ alert(“Data Loaded: ” + data); }); My PHP $user = $_GET[“username”]; if($user == “lazy”) echo “SUCESS”; else echo “FAIL”; I have googled… Read More »

Check if jQuery is included in Header (Joomla)

Questions: Is there a way to check if jQuery is loaded using PHP? I have two different plugins in Joomla that load the jQuery JS, but when it is included more than once it does not work correctly. To explain the process a bit more: Joomla offers an ability to intercept the HTML source before… Read More »