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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:47:36+00:00 2026-06-08T18:47:36+00:00

I am trying url persistence for the first time, and after a page load,

  • 0

I am trying url persistence for the first time, and after a page load, I have the elements that I want to click from the URL. When I load the page, the .click() does not register, but if i type it in the console, it performs correctly. I have tried placing the code(specifically the (function persistence(formvals){...})();) in the (document).ready(function(){…}) section, but that did not work. How do I get the .click() to register AFTER the page load, and on each element that should be clicked?

url: http://specialorange.org/resume/index.html?gc_abstract_heading&gc_ba_analysis

the two ids of these sections are :
gc_abstract_heading and
gc_ba_analysis
, so $(gc_abstract_heading).click() in the console works, just not in the code.

code:

var formvals = {};
var keyval = location.search.replace('?', '').split('&');
$.each(keyval, function () {
    var splitval = this.split('=');
    formvals[splitval[0]] = splitval[1];
});
console.log(keyval);
console.log(formvals);

(function persistence(formvals) {
    for ( i=0 ; i < keyval.length ; i++ ) {
        console.log(keyval[i]);         
        $(keyval[i]).click();
    };
})();

Please note that this code is not on the live page, it is on my local site for testing. The persistence section on the live page is different.

  • 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-08T18:47:37+00:00Added an answer on June 8, 2026 at 6:47 pm

    Try this:

    $(document).ready(function () {
        var formvals = {};
        var keyval = location.search.replace('?', '').split('&');
        for (var i = 0; i < keyval.length; i++) {
            console.log('Trigger click on: '+keyval[i]);
            $('#'+keyval[i]).click();
        };
    });
    

    First I’ve added document-ready, so the function does not fire until it’s ready. Second; the click-handler need # as a prefix if the name in the url points towards an id. If it’s a class you change # with ..

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

Sidebar

Related Questions

I am trying to have a URL that would look like: mysite.com/@username Which would
I'm trying to URL encode a string to form a GET request from objective-c.
I am getting the response from a URL and trying to create pdf from
I have a url and I am trying to extract the text before the
I'm trying to get an image from URL and save it to the isolated
Trying like this Url.Action(Index, Home, new { page = 5 }) is giving me
I am trying to parse url-encoded strings that are made up of key=value pairs
I am trying to load URL inside a WebViewClient as below: webview.setWebViewClient(new WebViewClient() {
I am trying to learn Hibernate from Java Persistence with hibernate by Gavin King.
I am trying to learn url persistence, and a friend told me to study

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.