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

  • Home
  • SEARCH
  • 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 9200885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:52:12+00:00 2026-06-17T22:52:12+00:00

I am using AJAX to navigate smoothly between page tabs that are setup like

  • 0

I am using AJAX to navigate smoothly between page tabs that are setup like this on my WordPress theme options page:

Theme Options Page

The tabs are working great and only content in the middle of the page is changed, which is the way I want it…..however due to AJAX loading only partial HTML on each page, my media upload button is no longer working (at least I believe that is the cause of the problem). I would like to know if there is a way to reset the scripts in each page so that my media uploader will work after each AJAX call.

Here is my code for handling the AJAX tab navigation:

jQuery.noConflict();

jQuery('.nav-tab').live('click', function(e){ 
   e.preventDefault();
   var link = jQuery(this).attr('href'); 

jQuery('.page-form').fadeOut(100).load(link + ' .page-form > *', function() { 
jQuery('.page-form').fadeIn(100).load(link + ' .page-form > *', function() {
  });
});
});

UPDATE: CODE ADDED FOR MEDIA UPLOAD:

<tr>
    <td>
        <label for="upload_image">
     <input style="float:left; width:80%" id="upload_image" type="text" name="upload_image" value="<?php echo $options['upload_image']; ?>" />
     <input style="float:right" id="upload_image_button" type="button" value="Upload Image" />

    <br/>
        </label>
<div id="image-holder">
   <img id="upload_image" name="upload_image" src="<?php if ($options['upload_image'] != "" ) { echo $options['upload_image']; } ?>" />
</div>

</td>

<td></td>

</tr>

HERE IS JQUERY I’M USING TO CALL THE IMAGE UPLOADER

jQuery(document).ready(function() {

jQuery('#upload_image_button').click(function() {
formfield = jQuery('#upload_image').attr('name');
tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
return false;
});

window.send_to_editor = function(html) 
{

imgurl = jQuery('img',html).attr('src');
jQuery('#upload_image').val(imgurl);
imgsrc = '<img src="'+imgurl+'">';
jQuery('#image-holder').html(imgsrc);
tb_remove();
}
});
  • 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-06-17T22:52:14+00:00Added an answer on June 17, 2026 at 10:52 pm

    Change

    jQuery('#upload_image_button').click(function() {
    

    to

    jQuery(document).on('click', '[id=upload_image_button]', function() {
    

    It’s not ideal to use the same id (in fact you should see if you can find a way to get around that), but this should make the click event on the Upload button work even if it was loaded asynchronously.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using AJAX to get data for several business-card like divs on my page
EDIT: iam using ajax to load text in my content that is why onload
I am using AJAX to send form data to a server php file that
I am using Ajax tab container control with 3 tabs. I have placed a
If I navigate here: http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js I download 70k using Firefox 3.6.3 and I can
I've created an ASP.NET WebService that is to be consumed using ASP.NET Ajax. The
I have an ajax function using jQuery that defines an error function to be
I have some (potentially) long-running ajax calls that I would like to abort if
In a jQuery Mobile application, I'm using Ajax to load a page with dynamic
The Setup: I have a page written in JS that has 3 main divs:

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.