![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Oct 2002
Posts: 111
|
Making Ajax calls with jquery in WordPress
I am trying to implement this script on a page in WordPress to make ajax calls with jquery to load content contained in the file /ajax/load.php to the <div id="result"> container.
<div id="result" class="functions"> </div> <div> <input type="submit" value="Next" id="load_basic" /> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $.ajaxSetup ({ cache: false }); var ajax_load = "<img class='loading' src='img/load.gif' alt='loading...' />"; // load() functions var loadUrl = "ajax/load.php"; $("#load_basic").click(function(){ $("#result").html(ajax_load).load(loadUrl); }); </script> The script works fine for me on a static hand-coded page, but I can't get working in WordPress. I've tried reading the WordPress codec and other sources and from what I gather I need to add the wp_enqueue_script function to function.php to get ajax working in WordPress. I am new to WordPress and ajax, and unfortunately I am not sure how to implement wp_enqueue_script. Can anyone provide some help on how to get this ajax load script working in WordPress? |
![]() |
![]() ![]() ![]() ![]() |