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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:31:47+00:00 2026-05-26T09:31:47+00:00

I have a navigation bar like this <div id=top data-role=navbar data-type=horizontal> <ul> <li><a href=#a>A</a></li>

  • 0

I have a navigation bar like this

      <div id="top" data-role="navbar" data-type="horizontal">
            <ul>
            <li><a href="#a">A</a></li>
            <li><a href="#b">B</a></li>
            <li><a href="#c">C</a></li>
            <li><a href="#d">D</a></li>
            </ul>
        </div>

And I have a <div id="content"> for example

Then I add my javascript

<script language="javascript">
$('div[id="top"] ul li a').live("click", function(e) {
    e.stopImmediatePropagation();
    e.preventDefault();
    var html = //SOME HTML
    var content = $('div[id="content"]');
    $(content).html(html);
});
</script>

However, It only works i.e. change the div content to my HTML if I click twice to the button, if I click one It only give me the default page. Any idea how to correct it ?

I create a fiddle here for you to test
http://jsfiddle.net/3Rcem/

I find a solution to use .click() instead of .live(‘click’) but with this I cannot bind to the ‘vclick’ which is suggested by Jquery mobile, anyone can help me with using live ?

  • 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-26T09:31:48+00:00Added an answer on May 26, 2026 at 9:31 am

    I don’t know why, but when I changed .live("click", to .click( it worked fine.

    BTW this: $('div[id="content"]') is not right. You should do $('div#content') and probably just $('#content').

    Also this: <script language="javascript"> is not correct, it should be: <script type="text/javascript">.

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

Sidebar

Related Questions

My horizontal navigation bar looks like this: | MENU-ITEM 1 | MENU-ITEM-2 | MENU-ITEM
I have a UIBarButtonItem on a navigation bar. I'd like to make it arrow
I have a tab-bar and navigation controller application (like Youtube app or Contacts app).
I have a view with navigation bar control on the top. The view is
I have a tableview with a navigation bar at the top. I've added text
I have this code that is my navigation bar on my site, it is
Basically, I am building a horizontal navigation bar. I have following markup: <ui:style src=../common.css
I have a horizontal navigation bar. Each button is a span with a background
I made this left navigation bar, like the picture below I want in in
I have opened a new window like this. I have to hide navigation toolbar

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.