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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:49:26+00:00 2026-06-17T13:49:26+00:00

When I saw the question and answer from : Problem jQuery with bbUI.js I

  • 0

When I saw the question and answer from :

Problem jQuery with bbUI.js

I want to ask.

Is the replacement syntax as in the question (using normal jQuery) :

$(document).ready(function () {
   $("#Div1").click(function () {
        alert("Hello world!");
   });
});

And replaced as in section in bbUI :

ondomready: function(element, id) {
    if (id == 'home') {
        $("#Div1").click(function () {
            alert("Hello world!");
        });
    }
}

Did not cause long syntax in index.htm file ???

Because I know the syntax above is at index.htm when using bbUI lib

If only doing alerts on syntax above is not visible. When using a lot of lines of code on a page whether it should be incorporated into index.htm like the statement above?

How if i use my sample code :

$("#DropDownList2").hide();
    $("#pertama").change(function () {
        if ($("#pertama option:selected").text() == "- Pilih Data -") {
            $("#DropDownList2").hide();
            $("select[id$=DropDownList2] > option").remove();
        }

        if ($("#pertama option:selected").text() == "Keren") {
            $("#DropDownList2").show();
            $("select[id$=DropDownList2] > option").remove();
            $("#DropDownList2").append($("<option>" + ("Hyderabad") + "</option>"));
            $("#DropDownList2").append($("<option>" + ("Vijayawada") + "</option>"));
            $("#DropDownList2").append($("<option>" + ("Karimnagar") + "</option>"));
        }
        if ($("#pertama option:selected").text() == "Jelek") {
            $("#DropDownList2").show();
            $("select[id$=DropDownList2] > option").remove();
            $("#DropDownList2").append($("<option>" + ("Madhurai") + "</option>"));
            $("#DropDownList2").append($("<option>" + ("Chennai") + "</option>"));
        }
        if ($("#pertama option:selected").text() == "Tidak Tahu") {
            $("#DropDownList2").show();
            $("select[id$=DropDownList2] > option").remove();
            $("#DropDownList2").append($("<option>" + ("Bangalore") + "</option>"));
        }

    });

Would look very much code in the main file

Is the only way out was to use a function in jQuery?

  • 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-17T13:49:28+00:00Added an answer on June 17, 2026 at 1:49 pm

    If I understand your question correctly…

    You can keep the main file clean by having functions declared for each page load. Store your functions in separate js files.

    ondomready: function(element, id) {
        if (id == 'home') {
            loadHomePage();
        }
    }
    

    …

    function loadHomePage() {
        $("#Div1").click(function () {
            alert("Hello world!");
        });
    }
    

    This is what I do in my app.

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

Sidebar

Related Questions

So I saw an answer in another question saying that this should work: using
So I saw this post which helped answer part of my question however now
After reading this question , i saw the answer by Naveen containing a link
I saw this question: how to save tags(keywords) in database? Good answer for how
I saw many similar question, but still not found the answer. How should look
I saw this instruction in an answer to the question Python progression path -
I already saw an answer here , but it didn't really answer my question.
I saw this question already, but I didnt see an answer.. So I get
I just saw this question and one of the answers looks really appealing to
I saw this question and it motivated me to look again (without success) at

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.