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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:19:29+00:00 2026-06-10T07:19:29+00:00

I am trying to use an ajax code in my site. My problem is

  • 0

I am trying to use an ajax code in my site. My problem is that I want only to use last part of the link.. otherwise the hash value becomes as here :

http://localhos./~ytsejam/wlog/public/#http://localhos./~ytsejam/wlog/public/index.php/

This is my line and ajax code for hashing :

window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-4);  

and here is my menu item in the source

<li><a href="http://localhos./~ytsejam/wlog/public/index.php/abouts">HAKKIMIZDA</a></li>

.

How can I change subsrt value to work here?

  • 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-10T07:19:30+00:00Added an answer on June 10, 2026 at 7:19 am

    Rather than parsing URL strings, I suggest you be more explicit in assigning data.

    Try something like this

    <a href="http://localhos./~ytsejam/wlog/public/index.php/abouts"
       data-hash="abouts">HAKKIMIZDA</a>
    

    Then use the data attribute in your event handler

    window.location.hash = $(this).data('hash');
    

    Update

    Using HTML::link_to_route(), you would do something like

    {{HTML::link_to_route('abouts', 'HAKKIMIZDA', array(), array(
        'data-hash' => 'abouts'
    ))}}
    

    I suggest you become familiar with the documentation for your framework of choice.

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

Sidebar

Related Questions

I am trying to use AJAX for a web app game that im making.
I am trying to use periodic refresh(ajax)/polling on my site by XMLHttp(XHR) to check
I am trying to use ajax like below; jquery code: $(a.generate).click(function(){ $.ajax({ data: {tag:
I'm experiencing a strange problem while trying to use the Ajax.BeginForm method of ASP.NET
current i am trying to use ajax for my site ....... because of size
I am currently trying to use AJAX in my application via jRails. I am
I am trying to use .ajax() to post a People object to a MVC2
I'm trying to use jquery.Ajax to post data to an ASP.NET MVC2 action method
I am using HMVC codeigniter. I am trying to use jquery ajax first time.
What I'm trying to do is to use ajax to get time from another

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.