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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:55:54+00:00 2026-05-22T16:55:54+00:00

What this little script does is it creates a context menu (right click) that

  • 0

What this little script does is it creates a context menu (right click) that has two options, delete and edit. Ideally it would just ask to confirm to delete, because it is not the end of the world if you accidentally get taken to the modify screen. But in either case, I would like to create some kind of unique message to each situation to display to the user.

$("#myDiv").contextMenu({

  menu: 'myMenu'

},

  function(action, el, pos) {    
  var yesno = confirm(    
  'Are you sure?'
   //you would like to delete? 
   //you would like to edit

);
  if (yesno == true) { 
    window.location(action);
  }

});

<div id="myDiv">

   Right click for options.

</div>

<ul id="myMenu" class="contextMenu">

  <li class="edit">   <a href="some/edit/page">   Edit   </a></li>
  <li class="delete"> <a href="some/delete/page"> Delete </a></li>

</ul>

I am not sure of what the accepted methodology would be in this case to grab some information about the actions, because the last thing I want is to write some super convoluted code when there is an easier way to do it.

This code seems moderately flexible, so I can add some more divs, or something like that. However, I would like to avoid a tag soup situation.

  • 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-22T16:55:55+00:00Added an answer on May 22, 2026 at 4:55 pm

    try using jQuery Alert plugin

    http://abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/

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

Sidebar

Related Questions

I've this little script which does it's job pretty well but sometimes it tends
I have this little script to toggle a contact form when a button is
I ended up writing a quick little script for this in Python, but I
I wanted to use groovy for a little ftp script and found this post
This is a little tricky so bear with me: I have a PHP script
This little bit of syntax has been a bit of a confusion for me
I made this little Cocoa app with a WebView that displays Google Maps in
I have this little problem, that I cannot figure out which arguments to pass
I have this little question that's been on my mind for a while now.
There's a little script that grabs a bunch of data from a database, and

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.