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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:55:19+00:00 2026-05-31T03:55:19+00:00

I have a small plugin from the net to fetch url params: $.extend({ getUrlVars:

  • 0

I have a small plugin from the net to fetch url params:

$.extend({
    getUrlVars: function () {
        var vars = [],
            hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    },
    getUrlVar: function (name) {
        return $.getUrlVars()[name];
    }
});

This extracts params from url, e.g.:

http://mysite.com/page?slideshow=video&title=General Overview

I want to match the title param to an existing link which has the same title as the param “title”, and do something if match found, in this case General Overview:

<a href="/some-colorbox-page" class="colorbox" title="General Overview">View video</a>


        var isSlideshow = $.getUrlVar('slideshow');
        if (isSlideshow === 'video' && $('a.colorbox', '.video').length) {
            var titleAttr = $('a.colorbox').attr('title');
            var title = $.getUrlVar('title');
            $(window).bind('load', function () {
                if (titleAttr  === title) {
                  $('a.colorbox', '.video').each(function()) {
                     $(this).trigger('click');
                  });
                }
            });
        }

But this doesn’t work.

Shortly, when a visitor visit the link (http://mysite.com/page?slideshow=video&title=General Overview), I want to trigger an event click to an element that has the same title as the value of url param “title”.

Note the white space between General and Overview. This thing makes the query a bit complicated. I can not control the title attributes, but may control the title param.

Any help would be very much appreciated.

Thanks

  • 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-31T03:55:20+00:00Added an answer on May 31, 2026 at 3:55 am

    Try this

    title = decodeURIComponent(
        (RegExp('title=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
    );
    $('a[title='+title).trigger('click');
    

    Tested fully works

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

Sidebar

Related Questions

I have a small requirement like . i need to fetch all record from
I have a small jQuery plugin that I use for form AJAX validation. There
I have written a small plugin to change the text size but it doesn't
I have a small piece of code that works as a plugin for a
I have small problem with my .net 2.0 winforms application. I want to embed
I'm trying to do the following: We have an outlook plugin, written in .NET
I have a small plugin for Rails where I add permalinks to my model
I am creating a small plugin get get's data from different websites. The data
I have a small question for you. How can I dinamicaly get a plugin
Background: I have a small problem with Eclipse. I'm working on a workbench plugin

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.