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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:45:30+00:00 2026-05-27T01:45:30+00:00

I am very inexperienced with jQuery plugins, and only mildly experienced in jQuery itself.

  • 0

I am very inexperienced with jQuery plugins, and only mildly experienced in jQuery itself.

I am trying to create a jQuery plugin that allows me to fill a div with content from another page with GET variables in the URL depending on the parameters that are passed to it.

Eg $('#mydiv').getstuff(1,2,3) would load it with code from engine.php?a=1&b=2&c=3.

Here is my code so far – I know there are problems with the way it takes in parameters but other than that I can’t figure out why it’s not working.

<script type="text/javasctipt" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
    (function($){
        $.fn.extend({ 
            //pass the options variable to the function
            bookmark: function(options) {
                var defaults = {
                    number: 5,
                    order: 1,
                    user: '',
                };

                var options = $.extend(defaults, options);

                return this.each(function() {
                    var o = options;
                    var obj = $(this);
                    var container = $("div", obj);

                    $("div", obj).load("thing.php?number="+o.number+"&order="+o.order+"&user="+o.user);
                });
            }
        });
    })(jQuery);

    $(document).ready(function() {
        $('#thing').bookmark(1,2,3);
    });
</script>

<div id="thing"></div>
  • 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-27T01:45:30+00:00Added an answer on May 27, 2026 at 1:45 am

    The problem I see is in these lines:

    var obj = $(this);
    $("div", obj).load("thing.php?number="+o.number+"&order="+o.order+"&user="+o.user);
    

    That last line says, “Get all div tags within obj,” which is to say, all div tags within the current jQuery context, which is div#thing. Just change it to:

    $(this).load("thing.php?number="+o.number+"&order="+o.order+"&user="+o.user);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a very inexperienced developer and have run into a problem that should
I am very inexperienced with SQL. I have a table that looks like this:
Very simply put: I have a class that consists mostly of static public members,
Very inexperienced with Flash, but I hope this is simple enough for someone to
I'm trying to create a multi-sheet excel document, and thus far I'd been doing
PREFACE: I'm relatively inexperienced in C++ so this very well could be a Day
While trying to learn c++, I tried to implement class representing very basic trie.
I've been playing around with a very simple JPA example and am trying to
I've been trying to put together a script which allows a user to select,
I am, a beginner to databases, and am very inexperienced at programming generally. For

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.