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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:32:00+00:00 2026-06-05T15:32:00+00:00

I’m working on some code to insert a link to a dupe in the

  • 0

I’m working on some code to insert a link to a dupe in the SO close question popup:

Close as dupe

What happens when you manually insert a link to a question in the textbox is that some JS kicks in and fetches the question belonging to the URL. However when I insert an URL using javascript (Chrome extension) into the textbox the SO javascript never kicks in to retrieve the question. The code I am using to insert the URL of the dupe is:

$(document).on('click', '.cvhelper-dupelist li', function() {
  var url = $('a', this).attr('href');
  var $dupeBox = $('#duplicate-question');

  $dupeBox.val(url);
});

The above code successfully inserts the link in the textbox, however for some reason the SO javascript never kicks in to retrieve the question.

I’ve also tried the following to maybe force it to no avail:

$dupeBox.change();

and

$dupeBox.keyup();

To test what is happening you could open up the close as dupe popup (as above) of a random question and run:

$('#duplicate-question').val('http://stackoverflow.com/questions/8028957/headers-already-sent-by-php');

in the browsers console.

  • 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-05T15:32:04+00:00Added an answer on June 5, 2026 at 3:32 pm

    I think I figured out one way, but it’s rather fragile:

    $dupeBox.data('events').keydown[1].handler({keyCode: 13})
    

    This triggers the second keydown event handler of this element. And gives a keyCode for the stubbed event object.

    UPDATE

    found a better way:

    You can construct a jQuery.Event object with:

    var e = jQuery.Event("keydown", { keyCode: 64 });
    

    And trigger the event with this object:

    $dupeBox.trigger(e)
    

    The problem was that the SO code checked whether there was something in the event object:

    e(d).keydown(c).bind("paste", null, function(a) {
      a.which || c(this)
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.