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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:45:40+00:00 2026-05-31T08:45:40+00:00

Let me preface this question by saying there may be a completely different solution

  • 0

Let me preface this question by saying there may be a completely different solution than my title so let me tell you what I am after entirely.

Basically I have a series of menu links. The href in all the links are storing jQuery functions, not URL’s (to control turn.js book script). So one of the href‘s may look like so:

<li id="menu-item-68" class="home menu-item menu-item-type-custom menu-item-object-custom menu-item-68">
  <a href="$('#primary').turn(‘page’,1);"></a>
</li>

The request is simple…on click() of a menu item i need to execute the contents of the href. My first thought was to run through each link and store a temp string of the href and then use eval() but that looks to be a bad option from what I read.

So, how can I execute the contents of my href quickly and safely?

  • 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-31T08:45:42+00:00Added an answer on May 31, 2026 at 8:45 am

    How about use the onclick event?

    <a onclick="function(){$('#primary').turn('page', 2); return false;}" href="#">Click me!</a>
    

    Alternately, since you’re using JQuery, you could .bind() the event:

    <script>
        $('a.clickable').bind('click', function(e){
             var pageNum = $(this).attr('data-page');
             $(#primary).turn('page', pageNum);
             return false;
        });
    </script>
    <body>
       <a class='clickable' data-page='2' href='#'>Click me!</a>
    

    Alternately, since you only have access to the href attribute, you COULD do this, which is the easy way out:

     <a href="javascript:$('#primary').turn('page', 2)">Click me!</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me preface this question by saying I use TextMate on Mac OSX for
Let me preface this question by saying I've exhausted Google, or at least what
Ok this may be a silly question for many of you. Let me preface
First let me preface this question by saying that I'm fairly new to Javascript.
First off, let me preface this question by saying that my professor is firmly
Let me preface this by saying that perhaps there's a better way to do
Let me preface my question by saying that I am completely unqualified to be
All right, let me preface this by saying: I'm not completely confident this is
Let me preface this question by saying that I am a .NET developer at
First off, let me preface this question by stating that I'm really a pretty

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.