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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:55:25+00:00 2026-06-17T05:55:25+00:00

I have this url: csumb/index.php?page=consultanta I try to compare 2 links but this code

  • 0

I have this url:

csumb/index.php?page=consultanta 

I try to compare 2 links but this code do the same thing if I change my link and I refresh the page.

var pathname = window.location.pathname;
var a = "csumb/index.php?page=consultanta";

if(pathname == a) {
    $("body").html("rahat");
}
  • 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-17T05:55:26+00:00Added an answer on June 17, 2026 at 5:55 am

    There’s multiple parts to location (or window.location, to use the literal reference):

    https://packagist.org/search/?search_query%5Bquery%5D=symfony

    Using console.log(location) directly into the Chrome console, it gives the following properties (plus some other stuff):

    hash: ""
    host: "packagist.org"
    hostname: "packagist.org"
    href: "https://packagist.org/search/?search_query%5Bquery%5D=symfony&page=4"
    origin: "https://packagist.org"
    pathname: "/search/"
    port: ""
    protocol: "https:"
    search: "?search_query%5Bquery%5D=symfony&page=4"
    

    What you’re really after is:

    var pathname = location.pathname + location.search;
    var a = "/csumb/index.php?page=consultanta";
    //       ^ Note the / at the beginning
    

    The filename, if in the URL, will be in location.pathname, so index.php will not need to be added separately either.

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

Sidebar

Related Questions

i want rewrite it with a .htaccess i have this url: ../index.php?page=details&id=123456 like this:
Let's say I have this url: www.example.com/test.php?page=4 How do i retrieve the value of
I have this url, http://website.com/?slug=product_info.php&products_id=28 and wanted to rewrite it to: http://website.com/page/product_info/product_id/28 How to
I have this url to display the properties: index.php?option=com_jea&view=properties&city=2:citta&Itemid=164 with sef: sito.it/2-citta.html This url
I have this url: http://mysite.com/content/14 and this line in htaccess file: RewriteRule ^content\/([^-]+)$ index.php?m=apple&id=$1
I have this url structure: proyectos.example.com/ci-doctrine/index.php proyectos.example.com/ci-doctrine/index.php/welcome proyectos.example.com/ci-doctrine/index.php/blog proyectos.example.com/ci-doctrine/admin.php proyectos.example.com/ci-doctrine/admin.php/welcome proyectos.example.com/ci-doctrine/admin.php/dashboard For index.php urls,
I have this code: PageList: function(url, index, classes){ this.url = url; this.index = index;
i tried this code to hide the php file extension i have this url
I have this url: http://localhost:8080/Test/jsp/index.jsp?userName=%E5%AE%98%E8%AF%9D . But when I tried to get the userName
Hi have this URL string which I need to extract possibly using regex but

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.