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 6987635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:57:47+00:00 2026-05-27T18:57:47+00:00

I am foxed by this… I am generating a slide show using the jQuery

  • 0

I am foxed by this… I am generating a “slide show” using the jQuery http://slidesjs.com plugin. Nothing fancy, except, I want to insert the contents of the slide via an ajax call. Everything works well, the html requested via ajax is retrieved successfully, no errors, except, the div holding the text doesn’t get updated. In other words, the $().html(data) line below does nothing. What am I doing wrong?

Here is a very simplified version of the code

<div id="slides">
    <div class="slides_container" id="slides_container"></div>
    <div id="controls">
      <a href="#" class="next"><img src="/img/arrow-prev.png"></a>
      <a href="#" class="prev"><img src="/img/arrow-next.png"></a>
    </div>
    <div class="pagination"></div>
</div>

<script type="text/javascript">
    var FOO = {
        "Pages": {
            "0": "Page0",
            "2": "Text_for_Page_2",
            "4": "A_Discourse_on_4",
            "7": "Seven_is_Heaven"
        }
    };

    $(function() {
        var str = "";
        for (var i = 0; i < 9; i++) {
            str +=  '<div class="slide">' + 
                    '<div id="#page_' + i + '" class="text"></div>' + 
                    '</div>';
        }

        $("#slides_container").html(str);
    });

    $(function(){
        $('#slides').slides({
            preload: false,
            effect: 'fade',
            animationStart: function(current) {
                if (FOO.Pages[current]) {
                    $.ajax({
                        url: '/path/to/' + FOO.Pages[current] + '.html',
                        type: 'GET',
                        dataType: 'text',
                        success: function( data ) {

                            // The following line does nothing
                            $("#page_" + current).html( data );
                        }
                    });
                }
            }
        });
    });
</script>
  • 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-27T18:57:47+00:00Added an answer on May 27, 2026 at 6:57 pm

    Typo in the below function

      ` $(function() {
        var str = "";
        for (var i = 0; i < 9; i++) {
            str +=  '<div class="slide">' + 
                    '<div id="#page_' + i + '" class="text"></div>' + 
                    '</div>';
        }
    
        $("#slides_container").html(str);
      });
    

    `

    Change

    '<div id="#page_' + i + '" class="text"></div>' + '</div>';

    to

    '<div id="page_' + i + '" class="text"></div>' + '</div>';

    NOTE: the div id page has # before it..

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

Sidebar

Related Questions

I've been playing around with http://nixboxdesigns.com/projects/jquery-lavalamp/ for a navigation menu on a new site
I'm implementing a table with a fixed header using this kind of setup: <div
Edit: This is a confirmed bug in jQuery 1.3.1. It is fixed in jQuery
I have to admit, this one has me foxed. Consider this code: use version;
This has got me completely foxed for a couple of days now, and I
I got the tutorial http://www.rmunn.com/sqlalchemy-tutorial/tutorial.html When I compile got the error message The debugged
I have been using the STOMP protocol in various guises. I have experienced this
I have a problem with IE. I have a fixed div like this: #fixed
I'm currently working on wholesale online t-shirt shop. I have done this for fixed
This problem is easy fixed clientside. But for performance I want to do it

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.