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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:58:18+00:00 2026-06-06T13:58:18+00:00

The script is on jsfiddle here : CODE What it does at the moment

  • 0

The script is on jsfiddle here : CODE

What it does at the moment: it’s a form that have two types of URL field textarea and input, it converts the texts in those fields to a link to be click-able.

How it works: if you click next to the link/links you can edit the link or on a double click on the link. IF you click once on the link it takes you to that page.

Last update: i added the .trigger('blur'); on the last line, Because before i did that, the text area was showing the links like one merged link, for example : test.com and test2.com were showing test.comtest2.com, after i added this last update, the split for textera work also on the load of page not just on the edit of textarea ( it was working without the last update but only when you edit the textarea and put between links a space, and i want it to be working on the load of page because the textarea format was sent already as one link pre row ).

My problem: after i did this last update, the double click is messed up, it should just be able to edit the link and don’t go to that page unless one click, but now it edits it and in like one second it goes also to that page. I want the double click just to edit without going to that page. and to go only with one click.

Thanks a lot in advance!

The code also here:

$('.a0 a').click(function(){

var href = $(this).attr('href');

// Redirect only after 500 milliseconds
if (!$(this).data('timer')) {
   $(this).data('timer', setTimeout(function () {
      window.open(href, '_blank')
   }, 500));
}
return false; // Prevent default action (redirecting)});

$('.a0').dblclick(function(){
clearTimeout($(this).find('a').data('timer'));
$(this).find('a').data('timer', null);

$(this).parent().find('input,textarea').val($(this).find('a').text()).show().focus();
$(this).hide();})

$('.a0').click(function(){
       $(this).parent().find('input,textarea').val($.map($(this).find('a'),function(el){return $(el).text();}).join(" ")).show().focus();
$(this).hide();})

$('#url0, #url1,#url4').each(
function(index, element){
    $(element).blur(function(){
            var vals = this.value.split(/\s+/),
    $container = $(this).hide().prev().show().empty();

$.each(vals, function(i, val) {
    if (i > 0) $("<span><br /></span>").appendTo($container);
    $("<a />").html(val).attr('href',/^https?:\/\//.test(val) ? val : 'http://' + val).appendTo($container);;
});  })
}).trigger('blur');
  • 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-06T13:58:20+00:00Added an answer on June 6, 2026 at 1:58 pm

    A double-click is always predeeded by the following chain of events:

    mousedown, mouseup, click, mousedown, mouseup, click, dblclick

    You can make your click-events wait and check if a double-click event happened afterwards. setTimeout is your friend. Be sure to copy any data you need from the event object passed to your handler. That object is destroyed after the handler finished – which is before your delayed handler is invoked.


    You can manually dispatch a double click event to prevent click-events from being executed prior to them. See the Fiddle

    // ms to wait for a doubleclick
    var doubleClickThreshold = 300;
    // timeout container
    var clickTimeout;
    $('#test').on('click', function(e) {
        var that = this;
        var event;
    
        if (clickTimeout) {
            try {
                clearTimeout(clickTimeout);
            } catch(x) {};
    
            clickTimeout = null;
            handleDoubleClick.call(that, e);
            return;
        }
    
        // the original event object is destroyed after the handler finished
        // so we'll just copy over the data we might need. Skip this, if you
        // don't access the event object at all.
        event = $.extend(true, {}, e);
        // delay click event
        clickTimeout = setTimeout(function() {
            clickTimeout = null;
            handleClick.call(that, event);
        }, doubleClickThreshold);
    
    });
    
    function handleClick(e) {
        // Note that you cannot use event.stopPropagation(); et al,
        // they wouldn't have any effect, since the actual event handler
        // has already returned
        console.log("click", this, e);
        alert("click");
    }
    
    function handleDoubleClick(e) {
        // this handler executes synchronously with the actual event handler,
        // so event.stopPropagation(); et al can be used!
        console.log("doubleclick", this, e);
        alert("doubleclick");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My script is here : jsfiddle i have two attributes in my form that
CODE HERE: http://jsfiddle.net/B7Y43/ Hello fello programmers, I have the following situation: My PHP-script generates
I have this bit of jQuery script that can be found here: http://jsfiddle.net/RUqNN/45/ When
I have this script http://jsfiddle.net/gphp/ZMmRv/4/ I have two events: 1 - the div is
hello friends i have tryied folowing code as u can see here http://jsfiddle.net/QCdz4/ i
So here is my snake script - http://jsfiddle.net/6bKHc/24/ I started to create a snake
I have been transferring this script (http://jsfiddle.net/darkajax/FHZBy/) in to my live environment within a
I have a custom accordion script - http://jsfiddle.net/nJpNb/2/ What I want to be able
I have a script which allows to display search results on keyup: JsFiddle I
I have this jsfiddle . When I move the script from the upper panel

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.