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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:05:14+00:00 2026-05-27T21:05:14+00:00

For example if location.href = ‘http://mydomain.com/en/’ and I have <a href=my-file.html id=myId>i am just

  • 0

For example if

location.href = 'http://mydomain.com/en/'

and I have

<a href="my-file.html" id="myId">i am just a link</a>

so

href = $('a#id').attr('href');

for some reason Firefox, Chrome and Opera return: my-file.html

but IE7 will return: http://mydomain.com/en/my-file.html

I tried this function with the domain-name but gives an error:

function str_replace(busca, repla, orig)
{
    str     = new String(orig);
    rExp    = "/"+busca+"/g";
    rExp    = eval(rExp);
    newS    = String(repla);
    str = new String(str.replace(rExp, newS));
    return str;
}

domain-name is not defined
[Detener en este error] rExp = eval(rExp); 

Any ideas for how to prevent it???

  • 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-27T21:05:14+00:00Added an answer on May 27, 2026 at 9:05 pm

    Try following :

    
    //this will give you filename only
    var chk = "http://mydomain.com/en/test.html";
    var chkArr = chk.split("/");
    var filenameOnly = chkArr.pop();
    
    

    Hope it helps

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

Sidebar

Related Questions

Say I have the following code: <div onclick='location.href=http://www.example.com/'> <a href='#' onclick='alert(blah)'>click</a> </div> Is there
This is a nasty one. I have an external link. <a href=http://www.example.com target=_blank> now
I have this code inside a file located at http://example.com/analytics.js and referenced in the
I want to get the location and the first folder, like: http://www.example.com/test/ var $location
on the following URL: www.example.com/page/#2221 Chrome will return www.example.com/page/# for document.location.href Firefox will return
I have downloaded the jquery scroll script (http://www.position-absolute.com/articles/better-html-anchor-a-jquery-script-to-slide-the-scrollbar/) which will scroll to your anchor
Take this code snippet for example: window.location.href = 'mysite.htm#images'; Already being on the site
concrete example http://img246.imageshack.us/img246/602/6x7gridsm.png By address I mean the location if you were counting left
does Flash comply with HTTP Location headers? For example, if Flash makes a POST
The URLs like below are supported on my site: (1) http://mysite.example.com/section/ - main page

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.