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

  • Home
  • SEARCH
  • 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 8838355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:58:24+00:00 2026-06-14T09:58:24+00:00

I have a simple JQuery code that will check the current URL and search

  • 0

I have a simple JQuery code that will check the current URL and search for a text; if it exists, execute some code. I am using switch Case. The code works in FF, IE but not in Webkit browsers, Chrome and Safari. Here is the code:

NB: Please assume the current URL include #f3 at the end – so case

$(document).ready(function() {      

    var checkUrl = $(location).attr('href');

        switch (true) {

        case (checkUrl.search("#f1") > 0):
            //just focus on #f3 below
            break;

        case (checkUrl.search("#f2") > 0):
            //just focus on #f3 below
            break;

        case (checkUrl.search("#f3") > 0):
            //$(".jcarousel-next").trigger("click");
            $(".jcarousel-next").triggerHandler('click');

            break;

        default:
            false;

        }
});

What this should do is simulate a div with class ".jcarousel-next" being clicked on the page. Chrome and Safari does nothing (apart from just loading the page). Works in Firefox, IE etc…

Any solution guys?

  • 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-14T09:58:25+00:00Added an answer on June 14, 2026 at 9:58 am

    I updated the code and now works for all required browsers (ie7, ie8, ie9, FF, Chrome & Safari). This is an example of what will sit in one of the cases (case2):

    for (var i =1; i <2; i++) {
    setTimeout(function () { $(“.jcarousel-next”).click(); }, 700 * i);
    }

    The for loop will action the required code for a certain number of times with a sort of interval to to delay the clicking, otherwise, the loop happens so quick you don’t see it.

    Thanks to all for their suggestions.

    Abu K.

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

Sidebar

Related Questions

I have a simple jQuery code that runs on a web page that has
I am building a PhoneGap/Cordova app and have a simple code that uses http://ricostacruz.com/jquery.transit/
Trying to get comfortable with jQuery and I have encountered some sample code that
I have created a simple search field that will ajax in relevant search results
I have written some JavaScript code that will read from the Google Maps API
i'm in search of a simple jquery image flipper/fader , that will cycle through
I have inherited some code that will eventually be part of an API call.
I have a simple jQuery image changer, that when you hover over it will
I have pretty simple jquery code : $(document).ready(function(){ $('img.marqFl').on({ mouseenter: function() { $(this).animate({height: 300},
I have a very simple JavaScript/jquery code which won't just work correctly. The problem

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.